From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.net.au (8.7/8.7) with SMTP id MAA12352 for ; Fri, 20 Oct 1995 12:17:29 +1000 (EST) Received: from euclid (euclid.skiles.gatech.edu) by gatech.edu with SMTP id AA00897 (5.65c/Gatech-10.0-IDA); Thu, 19 Oct 1995 22:00:49 -0400 Received: by euclid (5.x/SMI-SVR4) id AA23329; Thu, 19 Oct 1995 21:59:36 -0400 Old-Return-Path: Resent-Date: Thu, 19 Oct 1995 21:57:00 -0400 Old-Return-Path: Message-Id: <9510200157.AA24325@redwood.skiles.gatech.edu> X-Mailer: exmh version 1.6.4 10/10/95 To: Toshi Isogai Cc: zsh-users@math.gatech.edu Subject: Re: Filename Expansion In-Reply-To: Your message of "Thu, 19 Oct 1995 18:52:02 MDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 19 Oct 1995 21:57:00 -0400 From: Richard Coleman Resent-Message-Id: <"titEi.0.Ei5.2AmXm"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/105 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > 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@math.gatech.edu