Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: loop exited when error occurs?
- X-seq: zsh-users 4260
- From: Michal Vitecek <M.Vitecek@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: loop exited when error occurs?
- Date: Wed, 19 Sep 2001 10:59:57 +0200
- In-reply-to: <20010919095851.A2220@xxxxxxxxxxxxxx>; from M.Vitecek@xxxxxxxxxx on Wed, Sep 19, 2001 at 09:58:51AM +0200
- Mail-followup-to: Michal Vitecek <M.Vitecek@xxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20010919095851.A2220@xxxxxxxxxxxxxx>
correction - there's a typo in the initialization of 'nonexistentdirs'.
it should read 'nonexistentdirs=(aaa bbb ccc)'. sorry.
Michal Vitecek <M.Vitecek@xxxxxxxxxx> wrote:
> [ i apologize for sending this to zsh-workers first - a copy&paste
> mistake ]
>
> hello,
>
> i've come across another strange behaviour of zsh. if an error occurs the
> loop is exited and the code below it is executed (see example program).
>
> example program (test.sh):
>
> ----begin----
>
>#!/bin/zsh
>
>nexistentdirs=(aaa bbb ccc)
>while :; do
> files=(${nonexistentdirs}/*)
> echo "in the loop"
>done
>echo "out of loop"
>
> ----end----
>
> $ chmod +x test.sh
> $ ./test.sh
> ./test.sh:5: no matches found: ccc/*
> out of loop
> $
>
> $ mkdir aaa bbb ccc
> $ touch aaa/fileA bbb/fileB ccc/fileC
> $ ./test.sh
> in the loop
> in the loop
> ...
> [and so on]
>
> i'd expect zsh to simply continue executing commands after the faulty command
>but it exits the loop and continues simply below the loop. perhaps another bug?
>
> thanks for your help,
>--
> fuf
>
>
>------------------------------ na IRC -------------------------------------
> BillGates [bgates@xxxxxxxxxxxxxxxxx] has joined #LINUX
> ...
> mode/#linux [+b BillGates!*@*] by DoDad
> BillGates was kicked off #linux by DoDad (banned: We see enough of Bill
> Gates already.)
>
--
fuf
------------------------------ na IRC -------------------------------------
BillGates [bgates@xxxxxxxxxxxxxxxxx] has joined #LINUX
...
mode/#linux [+b BillGates!*@*] by DoDad
BillGates was kicked off #linux by DoDad (banned: We see enough of Bill
Gates already.)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author