[Top][All Lists]

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

Shouldn't this script terminate on ^C?

From: Nikolaus Schulz
Subject: Shouldn't this script terminate on ^C?
Date: Tue, 19 Feb 2013 19:42:14 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

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.

Thank you,

reply via email to

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