#252378 bash: bash does not exit on fatal shift error

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Date:
2024-04-15 12:21:04 UTC
Severity:
normal
Tags:
#252378#5
Date:
2004-06-03 01:01:29 UTC
From:
To:
herbert@bree:~$ bash -o posix -c 'shift 2; echo hi'
hi
herbert@bree:~$ dash -c 'shift 2; echo hi'
shift: 1: can't shift that many
herbert@bree:~$

#252378#10
Date:
2004-06-03 15:26:22 UTC
From:
To:
Would you classify this as a `utility syntax error'?  I don't -- it's a
simple out of range operand.  Other than that possibility, this doesn't
seem to fit into the list of errors that posix says should be fatal for
special builtins running in non-interactive shells.

Chet

#252378#15
Date:
2004-06-03 21:37:47 UTC
From:
To:
FWIW pdksh also exits like dash.

Cheers,