In that case, you should run these two commands: c:\working> ruby -e "puts ARGV.join(' - ')" *.txt c:\working> ruby -e "puts ARGV.join(' - ')" "*.txt" and they should produce the same output (i.e., "config.txt - tips.txt" or "tips.txt - config.txt") if the work is being done by the interpreter. If one of them produces simply "*.txt" (probably the second), then something different is going on. -Rob On Jun 9, 2007, at 5:30 PM, Michael Jia wrote: > I am using Windows XP "cmd" shell. What you described is true for unix > bash or C-shell. > > > C:\working>dir *.txt > Volume in drive C has no label. > Volume Serial Number is 5471-FCF7 > > Directory of C:\working > > 05/10/2007 03:24 PM 46,101 config.txt > 11/23/2004 11:54 AM 361 tips.txt > 2 File(s) 46,462 bytes > 0 Dir(s) 32,580,259,840 bytes free > > C:\working>echo *.txt > *.txt > > > That is why I think it is the ruby intepreter in Windows does the > expansion. > > Regards > Michael > > > Rob Biedenharn wrote: >> On Jun 9, 2007, at 2:18 PM, Michael Jia wrote: >> >>> >>> It seems to me that it is the ruby intepreter was linked to the >>> runtime >>> library, namely, startargv.obj, then it gets the expansion for >>> free. :) >>> >>> Can someone familiar with ruby build please clarify? >>> >>> -- >>> Posted via http://www.ruby-forum.com/. >> >> rab:Users/rab $ mkdir tmp >> rab:Users/rab $ cd tmp >> rab:rab/tmp $ touch foo.txt bar.pdf baz.rb >> rab:rab/tmp $ echo *.txt >> foo.txt >> rab:rab/tmp $ echo *.pdf >> bar.pdf >> rab:rab/tmp $ echo *.java >> *.java >> rab:rab/tmp $ >> >> It also depends what is in the directory at the time of the >> expansion. If there are no files that match the glob pattern, the >> shell (bash in this case) passes the argument as is (just as if it >> had been '*.java'). >> >> rab:rab/tmp $ ruby -e 'puts ARGV.join(" - ")' *.* >> bar.pdf - baz.rb - foo.txt >> rab:rab/tmp $ ruby -e 'puts ARGV.join(" - ")' *.txt >> foo.txt >> rab:rab/tmp $ ruby -e 'puts ARGV.join(" - ")' *.pdf >> bar.pdf >> rab:rab/tmp $ ruby -e 'puts ARGV.join(" - ")' *.java >> *.java >> rab:rab/tmp $ ruby -e 'puts ARGV.join(" - ")' b* >> bar.pdf - baz.rb >> rab:rab/tmp $ ruby -e 'puts ARGV.join(" - ")' *f* >> bar.pdf - foo.txt >> rab:rab/tmp $ ruby -e 'puts ARGV.join(" - ")' '*f*' >> *f* >> >> -Rob >> >> Rob Biedenharn http://agileconsultingllc.com >> Rob / AgileConsultingLLC.com > > > -- > Posted via http://www.ruby-forum.com/. >