From: Joel VanderWerf Date: 2004-06-08T07:19:40+09:00 Subject: Re: Newbie wondering about command line arguments Paul Emmons wrote: > And how, in general, do I make sure that a Ruby script does not try to > use an argument as an input file name if I want it to mean something > else? You can modify ARGV. $ cat >arg1 ARG1 $ cat >arg2 ARG2 $ ruby -e 'puts ARGF.read' arg1 arg2 ARG1 ARG2 $ ruby -e 'ARGV.pop; puts ARGF.read' arg1 arg2 ARG1 Note that ARGF.read is the same as calling Kernel#gets, except that it slurps the whole string (and I like it because it's a bit more explicit).