Merge sorin-ionescu/prezto/pull/1183

This commit is contained in:
Federico Castagnini 2016-12-29 00:46:08 -05:00
commit c5c466df9c
No known key found for this signature in database
GPG key ID: B8F54AA3DB400B54
2 changed files with 12 additions and 4 deletions

View file

@ -14,10 +14,13 @@
fi
} &!
# Print a random, hopefully interesting, adage.
if (( $+commands[fortune] )); then
if [[ -t 0 || -t 1 ]]; then
# Execute code only if STDERR is bound to a TTY.
[[ -o INTERACTIVE && -t 2 ]] && {
# Print a random, hopefully interesting, adage.
if (( $+commands[fortune] )); then
fortune -s
print
fi
fi
} >&2

View file

@ -5,9 +5,14 @@
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Execute code only if STDERR is bound to a TTY.
[[ -o INTERACTIVE && -t 2 ]] && {
# Print the message.
cat <<-EOF
Thank you. Come again!
-- Dr. Apu Nahasapeemapetilon
EOF
} >&2