From 6c529362023eea5f49a1f8106b3c1c59d2de1f7e Mon Sep 17 00:00:00 2001 From: Filip Matzner Date: Mon, 7 Aug 2017 23:47:36 +0200 Subject: [PATCH 1/2] Fix misinterpretaion of -- in printf --- tools/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index 348fcfc8b..5c1a0a2ef 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -34,7 +34,7 @@ check_optional_args() { case "$arg" in --batch) LAUNCH_ZSH_AFTER=0 - printf "${BLUE}--batch:${NORMAL} zsh will not be started after installation\n" + printf "%s\n" "${BLUE}--batch:${NORMAL} zsh will not be started after installation" ;; *) printf "${YELLOW}Unrecognized argument: ${BLUE}${arg}${NORMAL}\n" From 00ba2caaa683f7ca74d4b5d715c7dc02107b1c57 Mon Sep 17 00:00:00 2001 From: Filip Matzner Date: Mon, 7 Aug 2017 23:48:15 +0200 Subject: [PATCH 2/2] 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