I am working on automating some telnet
related tasks, using Bash scripts.
Once automated there will be no interaction of the user with telnet
(that is it will be totally automated)
The scripts looks something like this:
# execute some commands on the local system
# access a remote system with an IP address: 10.1.1.1 (for example)
telnet 10.1.1.1
# execute some commands on the remote system
# log all the activity (in a file) on the Local system
# exit telnet
# continue on with executing the rest of the script.
There are 2 problems I am facing here:
How to execute the commands on the remote system from the script (without human interaction)?
From my experience with some test codes, I was able to deduce that when the
telnet 10.1.1.1
is executed, telnet goes into an interactive session and the subsequent lines of code in the script are executed on the local system. How can I run the lines of code on the remote system rather than the local one?I am unable to get a log file for the activity in the
telnet
session on the local system. The stdout redirect I used makes a copy on the remote system (I do not want to perform a copy operation to copy the log to the local system). How can I achieve this functionality?