<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
if you need to automate an interactive command you can use expect [1][2]<br>
<br></blockquote>Thank you for your reply. I am trying like the followings:<br>#expect<br>>set name 172.16.17.160<br>>set user id<br>>set password pwd<br>>set cmd1 "cd /tmp"<br>>set cmd2 "cp log.cap /export/home"<br>
>set cmd3 "logout"<br>>spawn telnet $name<br>>expect "login:"<br>>send "$user"<br>>expect "Password:"<br>>send "$password"<br>>send "$cmd1"<br>
>send "$cmd2"<br>>send "$cmd3"<br>>exit<br>I don't see any error when executing, but at the end no file is being copied. Can you please correct me?<br>Thank you<br><br><br><br></div><br>