From 76d71889e287cb57d4243f3857af3de8ab7612ac Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Wed, 30 Sep 2020 20:09:13 +0200 Subject: [PATCH] don't run posix mode regress tests on ksh without -o posix --- src/cmd/ksh93/tests/attributes.sh | 5 +++-- src/cmd/ksh93/tests/options.sh | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cmd/ksh93/tests/attributes.sh b/src/cmd/ksh93/tests/attributes.sh index d3c2e0e8d..59b8acaf9 100755 --- a/src/cmd/ksh93/tests/attributes.sh +++ b/src/cmd/ksh93/tests/attributes.sh @@ -109,8 +109,9 @@ fi if [[ -o ?posix && $("$SHELL" -o posix -c 'xi=xi+4;echo $xi') != "xi+4" ]] then err_exit "attributes imported despite posix mode (-o posix)" fi -ln -s "$SHELL" "$tmp/sh" -if [[ $("$tmp/sh" -c 'xi=xi+4;echo $xi') != "xi+4" ]] +if [[ -o ?posix ]] && + ln -s "$SHELL" "$tmp/sh" && + [[ $("$tmp/sh" -c 'xi=xi+4;echo $xi') != "xi+4" ]] then err_exit "attributes imported despite posix mode (invoked as sh)" fi x=$(foo=abc $SHELL < dotfile # ====== # test that '-o posix' option (not having a letter) does not affect "$-" expansion # other than B = braceexpand +if [[ -o ?posix ]]; then ( command set +o posix 2>/dev/null opt1=${-/B/} @@ -541,6 +542,7 @@ print $'alias print=:\nprint foobar' > dotfile opt2=$- [[ $opt1 == "$opt2" ]] ) || err_exit '-o posix option affects $- expansion' +fi # ====== # ksh 93u+ did not honor 'monitor' option on command line (rhbz#960034)