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-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Calling script with parameter
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password