Operating System - HP-UX
1830257 Members
1952 Online
110000 Solutions
New Discussion

execute a remote scripts, but how to input the prompted msgs

 
Hanry Zhou
Super Advisor

execute a remote scripts, but how to input the prompted msgs

I am running the following command:

ssh root@remoteserver:/tmp/remote_script

however, in order to run /tmp/remote_script, I have to answer a few prompted questions(ex, "y"/"n"/"all"), how do I enter the answers from local system that is executing the ssh command?
none
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: execute a remote scripts, but how to input the prompted msgs

http://www.hpux.ws/buildmail.hpux.text

That link is to a script that shows you how to choose menu items and input data into a script without actually being on keyboard.

Its an example or template, that you can modify.

In actuality it works through a sendmail menu, but the basic scripting concepts you need are in the script.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Suraj Singh_1
Trusted Contributor

Re: execute a remote scripts, but how to input the prompted msgs

HI Hanry,

You may want to explore "EXPECT" software also.

It has made my life much simpler.

Regards,
Suraj
What we cannot speak about we must pass over in silence.