From owner-freebsd-questions@FreeBSD.ORG Mon Jan 31 19:22:42 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 585DB16A4CE for ; Mon, 31 Jan 2005 19:22:42 +0000 (GMT) Received: from sccimhc92.asp.att.net (sccimhc92.asp.att.net [63.240.76.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id E7BB843D58 for ; Mon, 31 Jan 2005 19:22:41 +0000 (GMT) (envelope-from FreeBSD@insightbb.com) Received: from [192.168.1.239] (12-202-28-183.client.insightbb.com[12.202.28.183]) by sccimhc92.asp.att.net (sccimhc92) with ESMTP id <20050131192241i9200q4edke>; Mon, 31 Jan 2005 19:22:41 +0000 From: Steven Friedrich To: freebsd-questions@freebsd.org, jaymo@cromagnon.cullmail.com Date: Mon, 31 Jan 2005 14:22:39 -0500 User-Agent: KMail/1.7.2 References: <200501300533.51350.jaymo@cromagnon.cullmail.com> <200501302223.00779.jaymo@cromagnon.cullmail.com> In-Reply-To: <200501302223.00779.jaymo@cromagnon.cullmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501311422.40265.FreeBSD@insightbb.com> cc: Timothy Luoma Subject: Re: running interactive program from shell script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2005 19:22:42 -0000 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...