From: Iain Patterson Date: Tue, 20 Nov 2018 16:20:59 +0000 (+0000) Subject: Silently handle the case of no *.prompt files existing. X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=8f5487f1fed69fc48c5681c506cf9076a6be5042;p=profile.git Silently handle the case of no *.prompt files existing. --- diff --git a/.profile.d/prompt.bashrc b/.profile.d/prompt.bashrc index e67a8fd..8114b29 100644 --- a/.profile.d/prompt.bashrc +++ b/.profile.d/prompt.bashrc @@ -10,4 +10,4 @@ if [ -n "$OLDSOLARIS" -a ! "${TERM##screen}" = "$TERM" ]; then unset _prompt_command_escape fi -PROMPT_COMMAND='for snippet in ${PROFILE_HOME:-~}/.prompt.d/*.prompt; do . $snippet; done; unset snippet' +PROMPT_COMMAND='shopt -q nullglob; ng=$?; shopt -s nullglob; for snippet in ${PROFILE_HOME:-~}/.prompt.d/*.prompt; do . $snippet; done; unset snippet; [ $ng = 0 ] || shopt -u nullglob; unset ng'