From 2ef3dff65a9fc0bc69446374473ad08e6fff4755 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 11 Sep 2017 10:12:17 +0100 Subject: 41668: New --emulate option on invocation. This sets the shell emulation mode similarly to ARGV0=... which doesn't work from other shells. Note that this gives more comprehensive emulation than running emulate within the shell. --- Test/B07emulate.ztst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Test') diff --git a/Test/B07emulate.ztst b/Test/B07emulate.ztst index 2de097e25..7b1592fa9 100644 --- a/Test/B07emulate.ztst +++ b/Test/B07emulate.ztst @@ -251,3 +251,28 @@ emulate sh -c '[[ a == a ]]' 0:regression test for POSIX_ALIASES reserved words F:Some reserved tokens are handled in alias expansion + + for mode in ksh bash zsh; do + $ZTST_testdir/../Src/zsh --emulate $mode -f -c 'emulate' + done +0:--emulate option +>ksh +>sh +>zsh + + $ZTST_testdir/../Src/zsh -f --emulate sh +1:--emulate must be first +*?*: --emulate: must precede other options + + $ZTST_testdir/../Src/zsh --emulate +1:--emulate needs an argument +*?*: --emulate: argument required + + for opt in shwordsplit noshwordsplit; do + $ZTST_testdir/../Src/zsh --emulate sh -f -o $opt -c ' + [[ -o shwordsplit ]] && echo yes || echo no + ' + done +0:--emulate followed by other options +>yes +>no -- cgit 1.4.1