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)