[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Calling script with parameter

Mat Howard

4/3/2007 11:49:00 PM

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
[code]$ ruby my-script.rb param1[/code]

--
Posted via http://www.ruby-....

2 Answers

Phillip Gawlowski

4/4/2007 12:11:00 AM

0

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
> [code]$ ruby my-script.rb param1[/code]

ARGV is what you seek. This is an Array containing all your parameters.

--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan....

Rule of Open-Source Programming #37:

Duplicate effort is inevitable. Live with it.

Mat Howard

4/4/2007 2:12:00 AM

0

Fanatastic. That worked beautifully. Thank you very much.


--
Posted via http://www.ruby-....