Hello,
I need to use two different libraries like /usr/local/bin/expect and /usr/bin/ksh at the same script. Is it possible?
Hello,
I need to use two different libraries like /usr/local/bin/expect and /usr/bin/ksh at the same script. Is it possible?
Yes, what I do is use a ksh script as normal (#!/bin/ksh at the top) and when I want to use expect I put the expect code in a separate scriptname.exp file (with #!/usr/local/bin/expect -f at the top, changing the location to suit) and call scriptname.exp from within the ksh script. So not quite using ksh(1) and expect(1) in the same script but I hope this is what you were trying to acheive?
Thanks a lot can i do the opposite. I mean can i first execute expect script then call ksh script. Actually i could not find a way that execute ksh script or another program in expect script.
---------- Post updated at 12:56 AM ---------- Previous update was at 12:27 AM ----------
Thanks a lot found the way.
send "./filename\r"
it works 
Have you tried:
spawn ./filename
?
yeah, i have tried that. it works also.
---------- Post updated at 02:07 AM ---------- Previous update was at 12:55 AM ----------
but there is a problem with spawn. whether the previous command or job is done or not , spawn command starts working. Not wait for previous command is finished