Operating System - HP-UX
1833682 Members
4877 Online
110062 Solutions
New Discussion

Scripting with interactive programs.

 
carl_46
Advisor

Scripting with interactive programs.

Does anyone know of a tool that would allow me to script with interactive programs?

thanks
3 REPLIES 3
Dave Cull
New Member

Re: Scripting with interactive programs.

The double redirect-input could be what you want, this allows you to place the replies that a command expects in the same script.
For example, we run UniVerse Pick on Unix 10.20 so the following will enter the UniVerse environment and execute UniVerse commands then return to the script


.
/opt/uv/bin/uv <SELECT VOC WITH @ID LIKE ...NIC...
DELETE VOC
ENDOFCOMMANDS
.


Be lucky.
The script runs the uv program and passes the following lines to it until it reaches the word ENDOFCOMMANDS. You can use any word you like, providing it is different to the actual commands you want to pass.
Darn! This is worse than finding a witty remark for a co-worker's leaving card!
carl_46
Advisor

Re: Scripting with interactive programs.

Good info, thanks, but I can't seem to get this to work with a simple telnet script, such as.

#!/bin/sh
telnet << job
open localhost
username
password
job

I know I can do this with a rhost file, I am just experimenting with this. Thanks.
Steven Sim Kok Leong
Honored Contributor

Re: Scripting with interactive programs.

Hi,

If you really want to supply inputs to interactive programs in a script, you should try the Expect scripting language. It comes with quite a number of sample scripts.

Works well with all interactive programs including minicom.

Regards.

Steven Sim.