How does one pass a command line, including arguments, from a Ruby script to the shell. Specifically
some_method("#{@script} -o #{@outfile} -f #{@format}")
I have tried Kernel.` Kernel.system, %x but have not hit on a correct syntax yet.
How does one pass a command line, including arguments, from a Ruby script to the shell. Specifically
some_method("#{@script} -o #{@outfile} -f #{@format}")
I have tried Kernel.` Kernel.system, %x but have not hit on a correct syntax yet.
By "testing" you just mean "running", right?
James Byrne wrote:
How does one pass a command line, including arguments, from a Ruby script to the shell. Specifically
some_method("#{@script} -o #{@outfile} -f #{@format}")
I have tried Kernel.` Kernel.system, %x but have not hit on a correct syntax yet.
It's just system(""). If your variables are valid, if your script is in the current right folder, and if your @outfile has no spaces in it, then the above should work with system("").
What error message do you get?
And note you can use popen() to route the output into a string in your program...