[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openbsd-misc
Subject:    Re: start interactive program from shell script
From:       Hugo Villeneuve <harpagon () jwales ! EINTR ! net>
Date:       2005-01-31 15:31:19
Message-ID: 20050131153119.GA19711 () jwales ! EINTR ! net
[Download RAW message or body]

On Mon, Jan 31, 2005 at 08:54:20AM +0000, John Wright wrote:
> On Sun, Jan 30, 2005 at 05:16:40PM -0600, J Moore wrote:
> > #! /bin/sh
> > 
> >     (sleep 3;
> >     echo "password";
> >     sleep 3;
> >     echo "ls -la";
> >     sleep 3;
> 
> cat < /dev/tty

cat will read its input in canonical mode. That's not really fun
to drive a shell/interactive program on the telnet remote session.

The only way I see this being possible is with "expect". Because
expect has the "interact" statement that can connect the user
keyboard back with the spawn'ed program in non-canonical mode.

> 
> >     ) | telnet -l user 192.168.0.2
> 
> I don't have a telnetd to test with but nc seemed to suggest that this would
> work with my cat addition.

-- 
Hugo Villeneuve <hugo@EINTR.net>
http://EINTR.net/ 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic