summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-07-16 16:22:37 +0000
committerRoy Marples <roy@marples.name>2007-07-16 16:22:37 +0000
commit42a5cb043b2280e8b667577c79fe6ed7a741b467 (patch)
treeff32a40d86c6e7c255ab9fd0d205046277775d82 /sh
parente983dd0ac64422bbf069b8dad3ce06d2cbbb3ac6 (diff)
downloadopenrc-42a5cb043b2280e8b667577c79fe6ed7a741b467.tar.gz
openrc-42a5cb043b2280e8b667577c79fe6ed7a741b467.tar.bz2
openrc-42a5cb043b2280e8b667577c79fe6ed7a741b467.tar.xz
Allow zsh to work as our shell
Diffstat (limited to 'sh')
-rw-r--r--sh/functions.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/sh/functions.sh b/sh/functions.sh
index 9b0da2d..1819486 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