Make shrc work with set -u

This commit is contained in:
Anthony Rose 2021-02-15 10:44:28 +00:00
parent 64b115d76e
commit 84c00d0562

View file

@ -1,7 +1,7 @@
#!/bin/sh
export ACP_SHRC=1
if [ "$ZSH_VERSION" ]; then
if [ "${ZSH_VERSION-none}" != "none" ]; then
emulate sh -c 'source /etc/profile'
fi
@ -128,19 +128,19 @@ export POWERSHELL_TELEMETRY_OPTOUT=1
export PYTHONWARNINGS="ignore::UserWarning"
PS1="$ "
if test -z "${HOST}"; then
if [ "${HOST-invalid}" != "invalid" ]; then
HOST="$(hostname 2>/dev/null || cat /etc/hostname)"
fi
if test $(id -u) -eq 0; then
export PS1="${HOST%%.*}# "
export PS1="${HOST-localhost%%.*}# "
else
export PS1="${HOST%%.*}$ "
export PS1="${HOST-localhost%%.*}$ "
fi
if test -x /usr/bin/tty; then
export GPG_TTY=$(tty)
fi
if [ "$BASH" ]; then
if [ "${BASH-none}" != "none" ]; then
HISTCONTROL=ignorespace:ignoredups
shopt -s histappend
bind '"\e[1;5C": forward-word'
@ -157,7 +157,7 @@ if [ "$BASH" ]; then
fi
fi
if [ "$ZSH_VERSION" ]; then
if [ "${ZSH_VERSION-none}" != "none" ]; then
# Command history.
autoload -Uz compinit && compinit
autoload -U history-search-end