[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Second trap invocation is ignored?
From: |
Eduardo A . Bustamante López |
Subject: |
Re: Second trap invocation is ignored? |
Date: |
Mon, 6 Apr 2015 08:10:03 -0500 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Read about set -T in the manual. Also, you have an error in your trap
definition. The $1 inside "..." will expand at *definition* time, not when the
trap is executed. See:
dualbus@yaqui ~/t % cat script
echo '
trap "echo $1" DEBUG
' > ./trapcmd
source ./trapcmd first
source ./trapcmd second
dualbus@yaqui ~/t % bash script
first
dualbus@yaqui ~/t % bash -T script
first
first
dualbus@yaqui ~/t % cat script2
echo '
trap "echo \$1" DEBUG
' > ./trapcmd
source ./trapcmd first
source ./trapcmd second
dualbus@yaqui ~/t % bash script2
dualbus@yaqui ~/t % bash -T script2
second
--
Eduardo Bustamante
https://dualbus.me/
- 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 <=
- 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?, 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