From: Michael Prokop Date: Thu, 22 May 2014 10:12:36 +0000 (+0200) Subject: zshrc: export SHELL only if unset, don't hardcode path for zsh binary X-Git-Tag: v0.9.6~5 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=cd0cfc77c94225e4955668c4d05a1b2a2b7e7f22 zshrc: export SHELL only if unset, don't hardcode path for zsh binary On e.g. FreeBSD zsh isnt' necessarily available as /bin/zsh, so let's make that more flexible. Also while at it export SHELL only if the variable is unset yet, since setting SHELL should be something the login system care about. Acked-by: Frank Terbeck --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 50898ce..0c60a9a 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -536,7 +536,12 @@ export PAGER=${PAGER:-less} export MAIL=${MAIL:-/var/mail/$USER} # if we don't set $SHELL then aterm, rxvt,.. will use /bin/sh or /bin/bash :-/ -export SHELL='/bin/zsh' +if [[ -z "$SHELL" ]] ; then + SHELL="$(which zsh)" + if [[ -x "$SHELL" ]] ; then + export SHELL + fi +fi # color setup for ls: check_com -c dircolors && eval $(dircolors -b)