[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIGINT in a sourced script does not clean up some special variables
From: |
Chet Ramey |
Subject: |
Re: SIGINT in a sourced script does not clean up some special variables |
Date: |
Sat, 19 Dec 2015 21:12:15 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
On 11/10/15 3:36 AM, Grisha Levit wrote:
> Apologies if I'm missing something about the expected SIGINT behavior. I've
> read through the previous SIGINT discussions but this still seems unexpected:
>
> $ declare -p BASH_ARGC BASH_ARGV BASH_SOURCE BASH_LINENO
> declare -a BASH_ARGC=()
> declare -a BASH_ARGV=()
> declare -a BASH_SOURCE=()
> declare -a BASH_LINENO=()
>
> $ source <(echo 'kill -INT $$')
>
> $ declare -p BASH_ARGC BASH_ARGV BASH_SOURCE BASH_LINENO
> declare -a BASH_ARGC=([0]="1")
> declare -a BASH_ARGV=([0]="/dev/fd/63")
> declare -a BASH_SOURCE=([0]="/dev/fd/63")
> declare -a BASH_LINENO=([0]="5")
>
> Additionally, FUNCNAME is not cleared in some cases:
Thanks for the report. This will be fixed in the next release of bash.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: SIGINT in a sourced script does not clean up some special variables,
Chet Ramey <=