I want to run a ruby script.rb from command prompt with different
parameters.
Something like…
script.rb pserver
how can I get ‘pserver’ in script?
like in Python I can use sys.argv[1]
I want to run a ruby script.rb from command prompt with different
parameters.
Something like…
script.rb pserver
how can I get ‘pserver’ in script?
like in Python I can use sys.argv[1]
From: Vapor … [mailto:[email protected]]
fr array ARGV
eg, first param is ARGV[0] or ARGV.first
kind regards -botp
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