← Back to team overview

registry team mailing list archive

[Bug 647450] [NEW] exit-ing in a trap handler uses the wrong exit code

 

Public bug reported:

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,

** Affects: dash
     Importance: Undecided
         Status: New

** Affects: dash (Ubuntu)
     Importance: Undecided
         Status: New

** Bug watch added: Email to dash@vger #
   mailto:dash@xxxxxxxxxxxxxxx

** Also affects: dash via
   mailto:dash@xxxxxxxxxxxxxxx
   Importance: Undecided
       Status: New

-- 
exit-ing in a trap handler uses the wrong exit code
https://bugs.launchpad.net/bugs/647450
You received this bug notification because you are a member of Registry
Administrators, which is the registrant for dash.



Follow ups

References