Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Filename Expansion



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?


Toshi Isogai   磯貝利明




Messages sorted by: Reverse Date, Date, Thread, Author