bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shouldn't this script terminate on ^C?


From: Bob Proulx
Subject: Re: Shouldn't this script terminate on ^C?
Date: Tue, 19 Feb 2013 12:55:49 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

Nikolaus Schulz wrote:
> Please consider this bash script:
> 
>   : | while true; do sleep 1; done
>   echo "After loop"
> 
> If I hit ^C while it runs, shouln't it terminate?
> 
> I have tested bash versions 4.2.37(1)-release, 4.1.5(1)-release,
> and 3.2.39(1)-release. (Debian Sid, Squeeze and Lenny.)
> 
> All these bash versions output "After loop".
> zsh and dash do exit immediately.  Which behaviour is correct?
> I couldn't find what POSIX says about this.

Read this reference for an analysis of this issue.

  http://www.cons.org/cracauer/sigint.html

Since this is being asked as a general question this would be a better
topic to start discussing first on on the help-bash mailing list.  As
currently stated it is too non-specific to be a bug report to
bug-bash.

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]