help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] too paranoid?


From: Greg Wooledge
Subject: Re: [Help-bash] too paranoid?
Date: Thu, 10 Mar 2016 12:54:59 -0500
User-agent: Mutt/1.4.2.3i

On Thu, Mar 10, 2016 at 10:33:15AM -0600, John McKown wrote:
> I appreciate the information. I was afraid that my tests were too
> simplistic. What triggered this was my starting to learn the GO language,
> which has a "defer" command. You can "defer" any number of commands and
> they will execute, in LIFO order, when the function in which they were
> executed ends, however that is: panic, return, or "fall off the end".
> Somewhat akin, conceptually, to thethe C language "on_exit()" or "atexit()"
> ability. I was trying for something similar in a script.

The analogous bash construct is an EXIT trap.

trap 'rm -f -- "$temp1"' EXIT



reply via email to

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