Stu Glancy wrote:

> This was close.  I removed the exit and it sill exited.  I'd like to
> take over manually once I get in.

What do you mean by 'manually'?  Are you just trying to fire up a telnet
session and get it logged in so a user can then start interacting with a
system?  If so, then you essentially have to write your own telnet
client/terminal emulator.  If the issue is that once you are in there is
something complex that needs doing automatically, but first you have to work
out what exactly has to be done, then life is a touch easier, but not much.

Bottom line is, that with or without the 'exit', once your telnet session
sees EOF on its input stream, it is going to terminate.  To prevent this
you'd have to come up with a way of redirecting your terminal io to the
script you've piped into telnet.  You could sort of do that with 'cat <
/dev/tty', but you'll see all sorts of buffering issues, and it won't work
when there's no associated terminal.  Trying to get around these problems in
a shell script will be harder than learning expect or perl ...

> Tom Firl wrote:
>
> >At any rate, the following has worked all right for simple
> tasks on an AIX system running Universe:
> >
> >SH -c '(sleep 1; echo username; sleep 1; echo password;
> sleep 5; echo "ls -l"; sleep 3; echo "exit") | telnet hostname'

You could try:

SH -c '(sleep 1; echo username; sleep 1; echo password; sleep 5; cat <
/dev/tty) | telnet hostname'

But I don't think it'll work as you'd like.

Cheers,

Ken
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to