On Wed, 30 Jan 2002 11:22:11 +0100, [EMAIL PROTECTED] wrote: >> Isn't glob() supposed to return only files that actually exist? > >No. glob() returns the files that exists, but only if there exists >at least one. Otherwise, it just does the { } expansion, and leaves >things as is. Just like in *some* shells. > > bash $ echo yy* > yy* > bash $ echo y?y > y?y > bash $ echo y{a,e,i,o,u,y,}y > yay yey yiy yoy yuy yyy yy > > ksh $ echo yy* > yy* > ksh $ echo y?y > y?y > ksh $ echo y{a,e,i,o,u,y,}y > y{a,e,i,o,u,y,}y > > csh % echo yy* > echo: No match > csh % echo y?y > echo: No match > csh % echo y{a,e,i,o,u,y,}y > yay yey yiy yoy yuy yyy yy
So, if fooa does exist and foob not, is this then supposed to return both "fooa" and "foob", or just "fooa"? glob("foo{a,b}") (I get them both anyway...) If it should be just "fooa", then I'd like to mote that solutions based upon this trick would be disqualified, because they won't work on all reasonable systems. :-) -- Bart.