From 42a5cb043b2280e8b667577c79fe6ed7a741b467 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 16 Jul 2007 16:22:37 +0000 Subject: Allow zsh to work as our shell --- sh/functions.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sh/functions.sh') diff --git a/sh/functions.sh b/sh/functions.sh index 9b0da2d0..18194862 100644 --- a/sh/functions.sh +++ b/sh/functions.sh @@ -119,6 +119,16 @@ KV_to_int() { echo "${KV_int}" } +# Allow our scripts to support zsh +if [ -n "${ZSH_VERSION}" ] ; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +fi + # Setup a basic $PATH. Just add system default to existing. # This should solve both /sbin and /usr/sbin not present when # doing 'su -c foo', or for something like: PATH= rcscript start -- cgit v1.2.3