zsh-users
 help / color / mirror / code / Atom feed
* [[ -f file* ]]
@ 2009-05-18  9:14 Atom Smasher
  2009-05-18  9:36 ` Matt Wozniski
  0 siblings, 1 reply; 5+ messages in thread
From: Atom Smasher @ 2009-05-18  9:14 UTC (permalink / raw)
  To: zsh-users

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-18 11:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-18  9:14 [[ -f file* ]] Atom Smasher
2009-05-18  9:36 ` Matt Wozniski
2009-05-18  9:55   ` Peter Stephenson
2009-05-18 11:35   ` Atom Smasher
2009-05-18 11:40   ` Frank Terbeck

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).