From 0fabaaf4ee69cfb2e3a310542d0204196cc2b2e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexander=20Steinb=C3=B6ck?= Date: Fri, 30 Jan 2009 21:04:14 +0100 Subject: [PATCH] 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. --- etc/zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)" -- 2.1.4