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

[[ -f file* ]]



if i want to test for the presence of one or more files matching a certain pattern, it seems non-trivial to do it with the normal "test" or conditional expressions.

so far this seems like the best way to do it:
	{ ls test* } 2> /dev/null | read -k 2 -u 0

if one or more files match the pattern "test*", read returns 0. if no files match the pattern, read returns >0.

is there a better way?

thanks...


--
        ...atom

 ________________________
 http://atom.smasher.org/
 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
 -------------------------------------------------

	"Wars not make one great." -- Yoda



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