Re: Clarification needed on signal spec EXIT

2012-10-21 Thread Chet Ramey
On 10/21/12 7:35 AM, Francis Moreau wrote: >> Yes, this is a bug in bash-4.2. The subshell doesn't properly reinitialize >> the traps if a trap has already been set in the parent. This was fixed in >> late July and will be in the next version of bash. > > That doesn't explain the following (tak

Re: Clarification needed on signal spec EXIT

2012-10-21 Thread Francis Moreau
Thanks for answering, however... On Sat, Oct 20, 2012 at 9:01 PM, Chet Ramey wrote: > On 10/16/12 4:00 PM, Bob Proulx wrote: >> Francis Moreau wrote: >>> -- >>> main_cleanup () { echo main cleanup; } >>> submain_cleanup () { echo sub cleanup; } >>> >>> trap main_cleanup EXIT >>> >>> t

Re: Clarification needed on signal spec EXIT

2012-10-20 Thread Chet Ramey
On 10/16/12 4:00 PM, Bob Proulx wrote: > Francis Moreau wrote: >> -- >> main_cleanup () { echo main cleanup; } >> submain_cleanup () { echo sub cleanup; } >> >> trap main_cleanup EXIT >> >> task_in_background () { >> echo "subshell $BASHPID" >> >> while :; do >>

Re: Clarification needed on signal spec EXIT

2012-10-20 Thread Francis Moreau
Chester, You could you clarify/help, please ? On Wed, Oct 17, 2012 at 11:13 AM, Francis Moreau wrote: > On Tue, Oct 16, 2012 at 10:00 PM, Bob Proulx wrote: >> Francis Moreau wrote: >>> -- >>> main_cleanup () { echo main cleanup; } >>> submain_cleanup () { echo sub cleanup; } >>> >>>

Re: Clarification needed on signal spec EXIT

2012-10-17 Thread Francis Moreau
On Tue, Oct 16, 2012 at 10:00 PM, Bob Proulx wrote: > Francis Moreau wrote: >> -- >> main_cleanup () { echo main cleanup; } >> submain_cleanup () { echo sub cleanup; } >> >> trap main_cleanup EXIT >> >> task_in_background () { >> echo "subshell $BASHPID" >> >> while :;

Re: Clarification needed on signal spec EXIT

2012-10-16 Thread Bob Proulx
Francis Moreau wrote: > -- > main_cleanup () { echo main cleanup; } > submain_cleanup () { echo sub cleanup; } > > trap main_cleanup EXIT > > task_in_background () { > echo "subshell $BASHPID" > > while :; do > # echo "FOO" > sleep 1 >

Re: Clarification needed on signal spec EXIT

2012-10-16 Thread Francis Moreau
Thanks for your prompt answer. On Tue, Oct 16, 2012 at 7:31 PM, DJ Mills wrote: > On Tue, Oct 16, 2012 at 1:26 PM, Francis Moreau > wrote: >> Hi, >> >> Currently the description of the builtin trap isn't enough regarding >> the description of the EXIT signal spec, IMHO. >> >> It says: "If a SIG

Re: Clarification needed on signal spec EXIT

2012-10-16 Thread DJ Mills
On Tue, Oct 16, 2012 at 1:26 PM, Francis Moreau wrote: > Hi, > > Currently the description of the builtin trap isn't enough regarding > the description of the EXIT signal spec, IMHO. > > It says: "If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from > the shell.", and nothing more, unless I'm

Clarification needed on signal spec EXIT

2012-10-16 Thread Francis Moreau
Hi, Currently the description of the builtin trap isn't enough regarding the description of the EXIT signal spec, IMHO. It says: "If a SIGNAL_SPEC is EXIT (0) ARG is executed on exit from the shell.", and nothing more, unless I'm missing some other points about it somewhere else (that would be un