I need a shell script that initiates a telnet session to another host. I have
come up with the following, but unfortunately it terminates when the script
is finished. What I wanted was for the telnet session to remain "alive" and
interactive until manually terminated.

Is there a way to accomplish this in a shell script?

I've been told that I'll have to use "expect" or similar to accomplish this,
but it seems to me that I should be able to do this using just Bourne shell

#! /bin/sh

(sleep 3;
echo "password";
sleep 3;
echo "ls -la";
sleep 3;
) | telnet -l user

freebsd-questions@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"