exit-ing in a trap handler uses the wrong exit code

Bug #647450 reported by Loïc Minier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dash
New
Undecided
auto-dash
dash (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: dash

Hi

dash -c 'trap "sh -c \"exit 4\"; exit" 0 1 2 3 9 11 13 15;exit 3'; echo $?
4

according to POSIX this should be 3:
http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_21

bash gets this right:
bash -c 'trap "sh -c \"exit 4\"; exit" 0 1 2 3 9 11 13 15;exit 3'; echo $?
3

Cheers,

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.