On Thursday, September 02, 2010 06:35:33 am Srinidhi wrote:
I have a situation where i have to invoke command line tools like
putty_sftp and OpenSSH from ruby script for automation, as out
application handles sftp uploads through these tools.
Would net-ssh work?
So the problem is i can single DOS command in ruby
No you can’t.
You probably mean:
here were are talking abt
multiple DOS commands to achieve the goal.
So what’s hard about that?
system(‘command1’, a, b, c)
system(‘command2’, d, e, f)
Also i have to pick up values like user id and password from excel
file(which i am doing using ruby).I have to know how to pass these
value to DOS batch file from ruby.
This sounds like it’s an NT batch question almost as much as a Ruby
Since you’re talking about id and password, I’d strongly recommend using
environment variables. If Windows works the way Unix does here, you
able to do something like:
ENV[‘USER_ID’] = ‘foo’
ENV[‘PASSWORD’] = ‘bar’
Then, from your batch file, refer to them as:
This is much more secure than, for example, putting them in the
But you want to make sure you clear those if you’re going to be running
commands which don’t need them.
It would be a boon if i can all the DOS commands in my ruby program
one by one,
Sounds like you don’t need to run them in parallel. What’s the problem