From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2995 invoked from network); 16 Jun 1999 14:31:18 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Jun 1999 14:31:18 -0000 Received: (qmail 24820 invoked by alias); 16 Jun 1999 14:30:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6668 Received: (qmail 24805 invoked from network); 16 Jun 1999 14:30:40 -0000 From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: pws-22: killing the ZSH loops problem Date: Tue, 15 Jun 1999 20:45:04 +0400 Message-ID: <001901beb74e$6b1dcdc0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 I wanted to gzip a bunch of files, so I did for i in *.txt do gzip $i done I overlooked that I had (plenty of) already gzipped versions, so after I hitted a couple of times "n" (as a reply to gzip, if I want to overwrite it) the next time I just hitted ^C to stop the whole story. It did not. It just killed the current gzip and for loop happily ran the next one. The easy way to reproduce it is bor@itsrm2:~%> while true while> do while> echo $((i++)) while> sh -c "read line" while> done 0 ^C 1 ^C 2 Note, that hitting ^C simply kills started command instead of killing the whole loop. The same happens with pws-19. ^Z does not help either - it stops the current inner command. Compare it with shell: bor@itsrm2:~%> sh $ i=0 $ while true > do > i=`expr "$i + 1"` > echo $i > sh -c "read line" > done 0 + 1 0 + 1 + 1 0 + 1 + 1 + 1 ^C $ (sorry, expr was wrong, but I have not used it for quite a long time). Note, that in shell it kills the whole loop. /andrej