[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

File template as command line param?

Bazsl

10/9/2007 6:00:00 PM

If I pass *.rb as a command line parameter to a Ruby script ARGV
contains the names of the files matching the template, not *.rb. Is
there a way to pass a file template as a command line parameter and have
it passed literally instead of being interpreted and expanded?

1 Answer

Brian Adkins

10/9/2007 10:50:00 PM

0

On Oct 9, 1:59 pm, Bazsl <h...@dbginc.com> wrote:
> If I pass *.rb as a command line parameter to a Ruby script ARGV
> contains the names of the files matching the template, not *.rb. Is
> there a way to pass a file template as a command line parameter and have
> it passed literally instead of being interpreted and expanded?

brian@imagine:~/temp$ cat > temp.rb
require 'pp'
pp ARGV
brian@imagine:~/temp$ ruby temp.rb *.rb
["back.rb", "junk.rb", "qsort.rb", "temp.rb"]
brian@imagine:~/temp$ ruby temp.rb "*.rb"
["*.rb"]