Hi,
I would like to send a value in a script by using a argument. For
example, that could be my command:
$ ./script.rb Hello world
And that could be my script:
puts “#{$1} #{$2}”
But I have try it and it do not work… Thank you for your help.
Hi,
I would like to send a value in a script by using a argument. For
example, that could be my command:
$ ./script.rb Hello world
And that could be my script:
puts “#{$1} #{$2}”
But I have try it and it do not work… Thank you for your help.
It’s perfect! xD
Thank you Jeremy
I believe the ARGV array is what you’re looking for.
–Jeremy
On Nov 14, 2007 11:55 AM, Zangief I. [email protected] wrote:
But I have try it and it do not work… Thank you for your help.
Posted via http://www.ruby-forum.com/.
–
http://www.jeremymcanally.com/
My books:
Ruby in Practice
My free Ruby e-book
My blogs:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs