I checked most of the post to solve this problem. But, I
Here the script,
Which telnets to another server and run a script and it has to
wait for that script/process to complete.
(sleep 5; echo "<uid>"; sleep 10; echo "<passwd>"; sleep 5; echo "<run
script>"; sleep 5;
echo "wait $!"; sleep 2; echo "exit"; sleep 5) | telnet <Server Name> >
tempfile 2> /dev/null
$! will give the process ID and with that process ID we can wait until
it completes using the wait on unix machines.
I don't want to do sleep .. want to wait until the process terminates.
It's able to login and exceute the <run script> and sleep for 5 sec.
But, it's not waiting (wait $!) for the script to run or process to
How can wait until the process terminates. not sleep 10 or sleep 100
Please, Help me to resolve this issue.
Thanks in advance,