Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to respond to system prompt Y/N ?

Status
Not open for further replies.

MTek1240

Technical User
Mar 22, 2007
10
US
Hi everybody,

I am new to Perl and didn't find answer to my question, so here it is:

How do I respond to system prompt Y/N ?

I wrote a Perl script that connects to FTP server, locate .tgz file, download, unTAR, start installation proccess, BOOM!!


System prompt appears: do you want to reboot Y/N

I tried

system "y"; # doesn't work

should I use pause or wait during installation?

Thanks in advance
 
You can use the Expect module or

If whatever is being installed can be pre set with commands to provide "y" for all args that the download exectable is requesting.

What are u installing a perl module?
 
Thank you!

No, I won't be able to pre set files, it would be new builds of software.

I'll try to find information on Expect module and use it

Also, is it posible to somehow read the system and then use ' system "y\n"; '

Thanks
 
Expect" works for telnet and ssh, how are you conecting to the FTP server?

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
I use Net::FTP

There would be 2 prompts

* "Do you want to compress old files?" I need to respond with "y"

* "Do you want to reboot?" respond "y
 
Why not FTP the files over then telnet over to start the install process?? Net::Telnet will handle prompts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top