tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Fix subst SUBST_NOOP_OK?=yes fallout
* On 2020-06-23 at 12:49 BST, Jonathan Perkin wrote:
> Ok? I'm slightly wary that I appear to be the only person seeing this
> as it's pretty spectacular breakage, so hence wondering if it's a
> pdksh nuance, but I at least don't see that there's any harm in adding
> this in lieu of a better-understood fix.
So it does appear to be specific pdksh. If you have the following:
$ cat test.sh
set -eu
[ "no,yes" = no,no ] && :
echo "still going"
then all of bash/ksh/pdksh/zsh behave the same, i.e.:
$ pdksh test.sh; echo $?
still going
0
However, if you put the construct inside a for loop, the behaviour
changes:
$ cat test.sh
set -eu
for i in 1 2 3; do
[ "no,yes" = no,no ] && :
done
echo still going
$ bash test.sh; echo $?
still going
0
$ ksh test.sh; echo $?
still going
0
$ pdksh test.sh; echo $?
1
I guess we chalk up one more reason to start looking for alternatives
to pdksh after the freeze, but will still need to program defensively
for quite some time until it is eradicated.
--
Jonathan Perkin - Joyent, Inc. - www.joyent.com
Home |
Main Index |
Thread Index |
Old Index