[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Second trap invocation is ignored?
From: |
Greg Wooledge |
Subject: |
Re: Second trap invocation is ignored? |
Date: |
Mon, 6 Apr 2015 11:10:55 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Apr 06, 2015 at 10:04:12AM -0500, Eduardo A. Bustamante López wrote:
> The `script2' I provided ran with set -T is the closest you'll get to what you
> expect, but, since DEBUG runs *before* the source command, it'll not work as
> you want.
It doesn't matter whether the old DEBUG trap runs before or after the
new trap is defined. It's not about the output. That's a red herring.
The problem is the second trap definition *does not stick*.
imadev:~$ echo 'trap ": one" DEBUG' > foo
imadev:~$ echo 'trap ": two" DEBUG' > bar
imadev:~$ trap - DEBUG
imadev:~$ source ./foo
imadev:~$ source ./bar
imadev:~$ trap -p DEBUG
trap -- ': one' DEBUG
It's still got the first definition, not the second one.
- Second trap invocation is ignored?, Scott Bronson, 2015/04/05
- Re: Second trap invocation is ignored?, Greg Wooledge, 2015/04/06
- Re: Second trap invocation is ignored?, Eduardo A . Bustamante López, 2015/04/06
- Re: Second trap invocation is ignored?, Scott Bronson, 2015/04/06
- Re: Second trap invocation is ignored?, Eduardo A . Bustamante López, 2015/04/06
- Re: Second trap invocation is ignored?,
Greg Wooledge <=
- Re: Second trap invocation is ignored?, Scott Bronson, 2015/04/06
- Re: Second trap invocation is ignored?, Eduardo A . Bustamante López, 2015/04/06
- Re: Second trap invocation is ignored?, Greg Wooledge, 2015/04/06
- Re: Second trap invocation is ignored?, Chet Ramey, 2015/04/10
- Re: Second trap invocation is ignored?, Scott Bronson, 2015/04/10
- Re: Second trap invocation is ignored?, Chet Ramey, 2015/04/11
Re: Second trap invocation is ignored?, Scott Bronson, 2015/04/06
Re: Second trap invocation is ignored?, Chet Ramey, 2015/04/10