[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
- [Help-bash] too paranoid?, John McKown, 2016/03/10
- Re: [Help-bash] too paranoid?, Stephane Chazelas, 2016/03/10
- Re: [Help-bash] too paranoid?, Bob Proulx, 2016/03/10
- Re: [Help-bash] too paranoid?, Stephane Chazelas, 2016/03/11
- Re: [Help-bash] too paranoid?, Bob Proulx, 2016/03/12
- Re: [Help-bash] too paranoid?, Stephane Chazelas, 2016/03/14
- Re: [Help-bash] too paranoid?, Bob Proulx, 2016/03/19
- Re: [Help-bash] too paranoid?, Stephane Chazelas, 2016/03/21
- Re: [Help-bash] too paranoid?, Bob Proulx, 2016/03/21
- Re: [Help-bash] too paranoid?, Stephane Chazelas, 2016/03/21