[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Anomaly
From: |
Chet Ramey |
Subject: |
Re: Anomaly |
Date: |
Sun, 25 Sep 2016 19:57:25 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 9/20/16 11:04 PM, PePa wrote:
> When sourcing this script (version 1), it will print y after receiving
> an interrupt, but not in the 2 different versions (2 and 3).
>
> # version 1
> echo x
> sleep 99
> echo y
>
> # version 2
> echo x; sleep 99
> echo y
>
> # version 3
> echo x
> sleep 99; echo y
>
> Is this a bug or expected behaviour??
Well, it's definitely a difference between three simple commands and a
command list. I think the right behavior is that exhibited by versions 2
and 3: the interrupt causes the execution of the sourced script to halt.
I'll take a look at it.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- Anomaly, PePa, 2016/09/21
- Re: Anomaly,
Chet Ramey <=