I am trying to write a ksh script of using telnet.
On server1, I have a script that wants to telnet to server2 and run it on server2. Then after finish, brings back information to server1. Is it possible? How can I write it on ksh?
Thanks for the reply.
In your answer, at the section 1 part 3, the script tried to delete the output file at the remoted server or you meant to delete at the local server?
After FTP the output file back to the local server at part 2, I assume you want to delete the output file at the remote server. Therefore, the part 3 of section 1 should somehow use telnet command statement like in part 1. right?
can you please help me to clearify my confusion?
In section 1 part 3 the script is deleting the file from the local server, not the remote server. After the password is changed, it will ftp to the remote server again, using the new password, and retrieve the file a second time. This guarantees that the password change took effect. The remote file is then deleted.
Maybe this is a really dumb question but: why don't you use rsh/rexec/remsh/et al. for this very purpose? Aren't these tools designed exactly for your situation?