From: Pierre Baillet Date: 2002-11-29T08:34:05+09:00 Subject: Re: too clever? On Fri, Nov 29, 2002, Shannon Fang wrote: > hi, > > Sometime, I think ruby is too clever. It automatically expand cmdline. > > For example: > > myprog *.txt good > > in a language like c or pascal, argv[0]="*.txt" argv[1]="good", but in > ruby, all txt file in the directory is put into the command line. This > may be good, but a drawback is it is not convenient to get the second > parameter, because ARGV.length is variable... What do you think? I think that you are playing too much with your shell : > oct@Colibri ~ % ruby -e "p ARGV" *.doc > zsh: no match Whereas: > oct@Colibri ~ % ruby -e "p ARGV" "*.doc" > ["*.doc"] My shell does the "*.doc" expansion if I forget to protect the *. between quotes. Yours has probably the same feature activated... Try and 'ruby myprog "*.txt" good' ... -- Pierre Baillet Avec un escalier pr�vu pour la mont�e, on reussi souvent � monter plus bas qu'on ne serait descendu avec un escalier pr�vu pour la descente. Devise Shadok