From 00ba2caaa683f7ca74d4b5d715c7dc02107b1c57 Mon Sep 17 00:00:00 2001 From: Filip Matzner Date: Mon, 7 Aug 2017 23:48:15 +0200 Subject: [PATCH] Fix expr statement with unset $SHELL variable In the official Ubuntu image from dockerhub, the SHELL variable is unset. This commit makes the installation script handle it. --- tools/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index 5c1a0a2ef..d7dcb069e 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -101,7 +101,7 @@ main() { mv -f ~/.zshrc-omztemp ~/.zshrc # If this user's login shell is not already "zsh", attempt to switch. - TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)') + TEST_CURRENT_SHELL=$(expr "${SHELL:=/bin/false}" : '.*/\(.*\)') if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then # If this platform provides a "chsh" command (not Cygwin), do it, man! if hash chsh >/dev/null 2>&1; then