From 53bac33b40807aab926af2749222b1e35f8f8c7b Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Thu, 21 Nov 2019 12:44:38 +0000 Subject: [PATCH] Use an if-else check for prompt character --- roles/home-cli/files/shrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/home-cli/files/shrc b/roles/home-cli/files/shrc index b89b9f7..35ec86b 100644 --- a/roles/home-cli/files/shrc +++ b/roles/home-cli/files/shrc @@ -32,7 +32,11 @@ PS1="$ " if /bin/test -z "${HOST}"; then HOST="$(hostname)" fi -export PS1="${HOST%%.*}$PS1" +if /bin/test $(id -u) -eq 0; then + export PS1="${HOST%%.*}# " +else + export PS1="${HOST%%.*}$ " +fi if [ "$BASH" ]; then shopt -s histappend