shell script, feed telnet, rlogin, or rsh with login
Posted on 2000-03-02
I'm writing a simple bourne shell script to connect to a host and execute a command, say, ls.
When I run the script, I provide the username at command line.
The problem is telnet prompts for username and passwd. I want to use the username I already have, say, in a variable, to feed it to the login prompt and enter.
The script will have no user interaction after being run.
The script will eventually be called by another file, so username and passwd and command will be provided in variables.
Please provide sample code.