File template as command line param?

B

Bazsl

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?
 
B

Brian Adkins

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"]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,271
Latest member
BuyAtenaLabsCBD

Latest Threads

Top