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.
This commit is contained in:
Filip Matzner 2017-08-07 23:48:15 +02:00
commit 00ba2caaa6

View file

@ -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