Does anyone know how to call a script with a parameter?
Essentially I have a bunch of commands to run, but I only want to run
one at a time. I’m running this script from a config file. Something
like
$ ruby my-script.rb param1
Does anyone know how to call a script with a parameter?
Essentially I have a bunch of commands to run, but I only want to run
one at a time. I’m running this script from a config file. Something
like
$ ruby my-script.rb param1
Mat Howard wrote:
Does anyone know how to call a script with a parameter?
Essentially I have a bunch of commands to run, but I only want to run
one at a time. I’m running this script from a config file. Something
like$ ruby my-script.rb param1
ARGV is what you seek. This is an Array containing all your parameters.
–
Phillip “CynicalRyan” Gawlowski
http://cynicalryan.110mb.com/
Rule of Open-Source Programming #37:
Duplicate effort is inevitable. Live with it.
Fanatastic. That worked beautifully. Thank you very much.
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