Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jan 2005 14:22:39 -0500
From:      Steven Friedrich <FreeBSD@insightbb.com>
To:        freebsd-questions@freebsd.org, jaymo@cromagnon.cullmail.com
Cc:        Timothy Luoma <lists@tntluoma.com>
Subject:   Re: running interactive program from shell script
Message-ID:  <200501311422.40265.FreeBSD@insightbb.com>
In-Reply-To: <200501302223.00779.jaymo@cromagnon.cullmail.com>
References:  <200501300533.51350.jaymo@cromagnon.cullmail.com> <dce54c84eb6186457fcbe553b3491393@tntluoma.com> <200501302223.00779.jaymo@cromagnon.cullmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 30 January 2005 11:23 pm, Jay Moore wrote:
> As for what I'm trying to do:
> I have a requirement to administer a number of remotely located embedded
> devices; these devices do not support ssh - only telnet. To avoid the
> obvious security issues, I am going to co-locate a "real" computer at each
> remote location. I will ssh into the "real" computer, and then telnet over
> a local network to the embedded device(s). I realize there are many ways of
> accomplishing this, but I'm kind of hung up on doing it "my way"  :)
>
> > > #! /bin/sh
> > >
> > >     (sleep 3;
> > >     echo "password";
> > >     sleep 3;
> > >     echo "ls -la";
> > >     sleep 3;
> > >     ) | telnet -l user 192.168.0.2
> >

I think all you need is to enclose it with a forever for loop.
I can't remember the syntax right now, but you can probably read man sh and 
figure it out. If you can't, let us know and I'll work it out...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501311422.40265.FreeBSD>