From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6293 invoked from network); 22 Oct 2002 02:49:51 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 22 Oct 2002 02:49:51 -0000 Received: (qmail 2811 invoked by alias); 22 Oct 2002 02:49:37 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5454 Received: (qmail 2794 invoked from network); 22 Oct 2002 02:49:35 -0000 Message-Id: <200210220249.g9M2nVO29377@throb.netspace.org> To: zsh-users@sunsite.dk From: bperkins@netspace.org Subject: signals in loops Date: Mon, 21 Oct 2002 22:49:31 -0400 I've been using zsh for a while, and I'd swear you used to be able to do this: for foo in 1 2 3 4 5 6 ; do xmessage $foo; done and you could give control-c to kill the xmessage and the next one would pop up. In fact in a bash FAQ I found (which has this same behavior, BTW), it said that if you wanted this to happen (with control-z anyway), you have to type: (for foo in 1 2 3 4 5 6 ; do xmessage $foo; done) Which make complete sense to me, since the for loop can't receive a signal unless it's a subshell. It seems that this essentially does things the old way: ( trap continue INT; for foo in 1 2 3 4 5 ; do xmessage $foo ; done) Which brings up a mostly acidemic question, what is the default "trap?" It seems to be something like: trap "break -1" INT Assuming that break -1 breaks from all loops. -- "I know you believe you understand what you think I said, but I am not sure you realise that what you heard is not what I meant." -- Alan Greenspan Brian Perkins bperkins@netspace.org