summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-11-08 09:31:26 -0500
committerScott Moser <smoser@ubuntu.com>2012-11-08 09:31:26 -0500
commit956e94d16ab9c94471d3829424e8bd5183f3a735 (patch)
treee4176833eccfae4531faa8ed3df22eae0c52a047 /tools
parent380bd3f3417c640191bdf90f6622f8bbbe12b5c7 (diff)
downloadvyos-cloud-init-956e94d16ab9c94471d3829424e8bd5183f3a735.tar.gz
vyos-cloud-init-956e94d16ab9c94471d3829424e8bd5183f3a735.zip
work with zsh by using 'emulate -L sh'.
This makes zsh act like 'sh', but only for the function local function. This way, we do not affect the user's shell, but get the behavior we want.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/Z99-cloud-locale-test.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/Z99-cloud-locale-test.sh b/tools/Z99-cloud-locale-test.sh
index 97c92166..3c51f22d 100755
--- a/tools/Z99-cloud-locale-test.sh
+++ b/tools/Z99-cloud-locale-test.sh
@@ -12,6 +12,11 @@
locale_warn() {
local bad_names="" bad_lcs="" key="" val="" var="" vars=""
local w1 w2 w3 w4 remain
+
+ # if shell is zsh, act like sh only for this function (-L).
+ # The behavior change will not permenently affect user's shell.
+ [ "${ZSH_NAME+zsh}" = "zsh" ] && emulate -L sh
+
# locale is expected to output either:
# VARIABLE=
# VARIABLE="value"