On Wednesday, July 24, 2013 11:46:15 AM David Korn wrote:
> Subject: Re: [ast-users] Regression in += operator
> --------
>
> I don't have bash43, what do you get for
>
> ~/doc/programs/bash43 -c 'typeset -i x=1; x+=1 command eval echo \$x;echo
$x'
~/doc/programs/bash43 -c 'typeset -i x=1; x+=1 command eval echo \$x; echo $x'
2
1
Bash didn't implement the integer attribute for += when a command was present
until very recently in the devel branch. The command builtin works correctly
in most shells. Zsh has a regression which broke its command builtin and will
print 2/2 (documentation says it should work correctly with setopt
POSIX_BUILTINS). I haven't reported this.
Also as an aside, POSIX unfortunately doesn't require "command" to suppress
fatal errors for special builtins like ksh and many other shells do. IMO, it
should. mksh is one that doesn't.
[ -f "$include" ] && command . "$include" # Race condition. Can be fatal.
f() {
x=$1
while command shift; do # Unchecked shift can be fatal.
...
done
}
--
Dan Douglas
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users