* Dan Muresan <danmbox@xxxxxxxxx> [2011-03-10 19:41]:
> Hi, is there some consensus on whether shift should cause a "fatal
> error" as reported by Herbert against bash:
>
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=252378
>
> # doesn't print anything
> dash -c 'shift 2; echo hi'
>
> My copy of SUSv3 doesn't seem to imply any "fatal error" handling
> requirement for shift:
>
> --- 8-X ---
> EXIT STATUS
>
> The exit status is >0 if n>$#; otherwise, it is zero.
>
> CONSEQUENCES OF ERRORS
>
> Default.
> --- 8-X ---
For IEEE Std 1003.1-2008 see section 2.8.1 "Consequences of
Shell Errors": a "utility syntax error (option or operand error)"
with special built-ins shall cause the shell to exit. That's what
dash, ksh93, and pdksh do.
--
Guido Berhoerster
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[LARTC]
[Bugtraq]
[Yosemite Forum]
[Photo]