From: Alexander Steinböck Date: Fri, 30 Jan 2009 20:04:14 +0000 (+0100) Subject: zshrc: Fix status() when $BAUD is unset X-Git-Tag: v0.3.62~11 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;h=0fabaaf4ee69cfb2e3a310542d0204196cc2b2e3;p=grml-etc-core.git zshrc: Fix status() when $BAUD is unset There are implementations of getty that don't export $BAUD. In these cases there is an empty value in the output of the status() function. This fixes it by only printing the baud-information field in case $BAUD is set to a non-empty value. --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index aa49255..edc6865 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3562,7 +3562,7 @@ status() { print "" print "Date..: "$(date "+%Y-%m-%d %H:%M:%S")"" print "Shell.: Zsh $ZSH_VERSION (PID = $$, $SHLVL nests)" - print "Term..: $TTY ($TERM), $BAUD bauds, $COLUMNS x $LINES cars" + print "Term..: $TTY ($TERM), ${BAUD:+$BAUD bauds, }$COLUMNS x $LINES cars" print "Login.: $LOGNAME (UID = $EUID) on $HOST" print "System: $(cat /etc/[A-Za-z]*[_-][rv]e[lr]*)" print "Uptime:$(uptime)"