I am writing a script using expect in which I have to rlogin to some host & after that I need to send some commands. Now I want to exit to that host and relogin again to som
Try this construct when command is time consuming:
command
. . . send "command\r" expect { timeout { puts "Running..." exp_continue } "%PROMPT%" { puts "Finished." } } send "next command\r" . . .
On timeout you will be continuosly waiting with exp_continue command for %PROMPT%.
timeout
exp_continue
%PROMPT%