Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Filename Expansion
- X-seq: zsh-users 105
- From: Richard Coleman <coleman@xxxxxxxxxxxxxxx>
- To: Toshi Isogai <toshi_isogai@xxxxxxxxxx>
- Subject: Re: Filename Expansion
- Date: Thu, 19 Oct 1995 21:57:00 -0400
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: Your message of "Thu, 19 Oct 1995 18:52:02 MDT." <Pine.SUN.3.91.951019183157.2004D-100000@wolfcreek>
> I am writing a script to search files in a certain pattern
> and manipulate them. Something like:
>
> for i in *.vhd; do
> # do some operation on $i here
> done
> # do other stuff
>
>
> This works fine if there is at least one file matches the
> pattern. Otherwise, it exits with an error and 'other stuff'
> never gets done.
>
> How can I make it so that it will just skip 'for' loop if
> there aren't any files matches the pattern?
for i in *.vhd(N); do
# do some stuff
done
The (N) says to use the nullglob option for this particular
glob pattern.
Richard Coleman
coleman@xxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author