[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: return exit code in EXIT trap

From: Robert E. Griffith
Subject: Re: return exit code in EXIT trap
Date: Tue, 2 Aug 2022 16:18:36 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

Oh darn, I have been writing bash scripts for a long time and have never found a novel bug. I was hoping this would be my first:)

The first (getyarn...) link renders as a blank page for me. What it is supposed to be?

Is there a reason why POSIX would want the return behavior to of function down the stack to behave differently when in a trap? Seems strange to me. It does seem like I have to go through all my library type functions and add a "$?" to every return since I cant guarantee that they wont indirectly be called from a trap.


On 8/2/22 15:55, Chet Ramey wrote:
On 8/2/22 3:38 PM, Robert E. Griffith wrote:
Is it known behavior that return without a parameter will not set the exit
code from the last command when called from the EXIT trap?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]