Make the prompt work when hostname command missing (Arch)
This commit is contained in:
parent
d24f4d442a
commit
d62494b2a2
1 changed files with 3 additions and 3 deletions
|
@ -32,7 +32,7 @@ export PYTHONWARNINGS="ignore::UserWarning"
|
|||
|
||||
PS1="$ "
|
||||
if /bin/test -z "${HOST}"; then
|
||||
HOST="$(hostname)"
|
||||
HOST="$(hostname 2>/dev/null || cat /etc/hostname)"
|
||||
fi
|
||||
if /bin/test $(id -u) -eq 0; then
|
||||
export PS1="${HOST%%.*}# "
|
||||
|
@ -269,6 +269,6 @@ if test -S "$SSH_AUTH_SOCK" && test -r "$HOME/.ssh/id_rsa" && [ $(ssh-add -l |
|
|||
ssh-add "$HOME/.ssh/id_rsa"
|
||||
fi
|
||||
|
||||
if [ -r $HOME/.shrc.$(hostname -s) ]; then
|
||||
. $HOME/.shrc.$(hostname -s)
|
||||
if [ -r $HOME/.shrc.$(hostname -s 2>/dev/null || cat /etc/hostname) ]; then
|
||||
. $HOME/.shrc.$(hostname -s 2>/dev/null || cat /etc/hostname)
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue