From owner-freebsd-questions Wed Oct 24 13:28:15 2001 Delivered-To: freebsd-questions@freebsd.org Received: from webs1.accretive-networks.net (webs1.accretive-networks.net [207.246.154.13]) by hub.freebsd.org (Postfix) with ESMTP id 8532737B401 for ; Wed, 24 Oct 2001 13:28:13 -0700 (PDT) Received: from localhost (davidk@localhost) by webs1.accretive-networks.net (8.11.1/8.11.3) with ESMTP id f9OKSAm22377; Wed, 24 Oct 2001 13:28:11 -0700 (PDT) Date: Wed, 24 Oct 2001 13:28:10 -0700 (PDT) From: David Kirchner X-X-Sender: To: Cc: Subject: Re: shell script that takes piped input? In-Reply-To: <20011024222356.B18891@xs4all.nl> Message-ID: <20011024132652.Y85958-100000@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 24 Oct 2001 rene@xs4all.nl wrote: > Hi, this might be off-topic, but I risk it anyway ;) > > I would like to be pointed to an example of how to program a shell-script > that can do something with a file it gets through a pipe, as such: > somehost%myconfig | myscript.sh > > Thanx in advance for any usefull answers you might share with me.. Check out the 'read' command in sh. Example: #!/bin/sh while read foo do echo $foo done To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message