From: Christian Madsen Date: 2006-09-29T12:50:11+09:00 Subject: Re: Automatic globbing of ARGV Just to clear things out, I am using win32. So I created a test.c program: void main(int argc, char *argv[]) { int i; for (i = 0; i < argc; i++) printf("%s\n", argv[i]); } test.exe *.c => *.c Which indicates that ruby does the globbing. Finally, after looking into the ruby source, I can see that in fact, ruby calls "ruby_globi" in win32.c. This also explains why dir-glob, '**', worked. -Christian Ken Bloom skrev: > On Wed, 27 Sep 2006 12:27:55 -0700, Christian Madsen wrote: > > > I found a funny feature of Ruby tonight: if possible, commandline > > arguments are automatically globbed. For instance in a directory with > > one file foo.bar: > > > > test.rb *.bar > > => ARGV = ['foo.bar'] > > > > test.rb *.html > > => ARGV = ['*.html'] > > If a file matching the glob exists, then your shell globs it. > If a file matching the glob doesn't exist, then > * csh spits out an error message, always > * bash just passes the glob unchanged (as "*.html" here) > > > -- > Ken Bloom. PhD candidate. Linguistic Cognition Laboratory. > Department of Computer Science. Illinois Institute of Technology. > http://www.iit.edu/~kbloom1/ > I've added a signing subkey to my GPG key. Please update your keyring.