Use an if-else check for prompt character

This commit is contained in:
Anthony Rose 2019-11-21 12:44:38 +00:00
parent 8ac7dd06fe
commit 53bac33b40

View file

@ -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