Automaic command enter

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:

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!

look for expect or rexpect

···

il Tue, 13 Jan 2004 07:55:30 -0700, Dave Moore davemoore22@hotmail.com ha scritto::

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:

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?