From 8f5487f1fed69fc48c5681c506cf9076a6be5042 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Tue, 20 Nov 2018 16:20:59 +0000 Subject: [PATCH] Silently handle the case of no *.prompt files existing. --- .profile.d/prompt.bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' -- 2.7.4