Automaic command enter

D

Dave Moore

I'm trying to use ruby to write a system admin script.

I have a bash scripted called ask, which prompts me
for a passcode.

What is the passcode: <enter here and hit ENTER>

I would like to have ruby to do the above for me automatically,
so in my script I have

#!/usr/bin/ruby -w
`ask`

Now how do I make ruby to enter the passcode without my interaction?

TIA!
 
G

gabriele renzi

il Tue, 13 Jan 2004 07:55:30 -0700, Dave Moore
I'm trying to use ruby to write a system admin script.

I have a bash scripted called ask, which prompts me
for a passcode.

What is the passcode: <enter here and hit ENTER>

I would like to have ruby to do the above for me automatically,
so in my script I have

#!/usr/bin/ruby -w
`ask`

Now how do I make ruby to enter the passcode without my interaction?


look for expect or rexpect
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top