> -----Original Message----- > From: nosuzuki / e-mail.ne.jp [mailto:nosuzuki / e-mail.ne.jp]On Behalf Of > John Kaurin > Sent: Friday, April 06, 2001 9:10 AM > To: ruby-talk ML; ruby-talk / netlab.co.jp > Subject: [ruby-talk:13524] ARGV > > > Some confusion on ARGV. > > If I have a file, say, Test.rb, with the line: > > p ARGV > > And, say, it exists in a directory with some > other ruby files, a.rb, b.rb, and c.rb. > > Then I invoke it like: > > ruby Test.rb -> [] > ruby Test.rb *.py -> ["*.py"] > ruby Test.rb *.rb -> ["Test.rb", "a.rb", "b.rb", "c.rb"] > > The first two cases I expected, but for the third > I expected ["*.rb"] rather than the expanded > wildcard output. > > Is this behavior correct? Is it documented somewhere? > Is there documentation on any other anomalies with > ARGV? This is not an anomaly - it is the correct shell behaviour. It expands wildcards to list of files, if there is a viable match for it, or sends wildcard as-is if no files match it. Aristarkh A Zagorodnikov, Lead Programmer, W3D Group http://www.w3d.ru /// xm / w3d.ru /// ICQ UIN 36987938