1753295 Members
6734 Online
108792 Solutions
New Discussion

expect tool

 
manikandan_3
New Member

expect tool

I am a beginner to expect tool , I used the expect tool script as a subshell of a KSH script. I had to do the folloeing things using that expect script . 1. login as a super user
2. uninstall and install a package
3. come out of the SU mode by giving exit .
4.Then to interact with the KSH .(main shell)

expect "#"
send "pkgadd -d \r"
expect "y,n,?"
send "y\r"
expect "successful"
send "exit\r"

The last command send "exit" was not executed .

Can any one help me out how to proceed and why this command was not executed .

If I have to comne out of the script and if the script should interact normally with the main shell wht command should i give inorder that the expect (subshell susccessfully interacts with KSH main shell)

Dilligent personality to acquire knowledge and to become an expertise in UNIX
1 REPLY 1
Rainer von Bongartz
Honored Contributor

Re: expect tool


First set

log_user 1

at the beginning of your script. This will give you enough output to debug your script.

Regards
Rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...