Operating System - Linux
1827283 Members
3447 Online
109717 Solutions
New Discussion

Need some help in expect scripting

 
anirudhasonar
New Member

Need some help in expect scripting

Hi All,

I have written one expect script to collect the dmesg and bt command output when machine is in kdb mode . But i want the script to check the condition that if get the kdb prompt then do the following steps or else pass one value to one file get out from script

#!/usr/bin/expect
set console CONSOLE
set port APORT

spawn telnet $console
sleep 2
send "\r"
expect "number:" {send $port\r}
sleep 0.5
send "\r"
expect kdb> {send bt\r}
send "dmesg 20\r"
sleep 5
expect eof


Please help me in this ?
Thanks