From owner-freebsd-questions Mon Nov 12 16:54: 2 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.itworks.com.au (mail.itworks.com.au [203.32.61.7]) by hub.freebsd.org (Postfix) with SMTP id 47BC337B416 for ; Mon, 12 Nov 2001 16:53:58 -0800 (PST) Received: (qmail 38128 invoked from network); 13 Nov 2001 00:53:56 -0000 Received: from mail.itworks.com.au (HELO mercury.itworks.com.au) (203.32.61.7) by mail.itworks.com.au with SMTP; 13 Nov 2001 00:53:56 -0000 Received: (qmail 38123 invoked by uid 100); 13 Nov 2001 00:53:56 -0000 Date: Tue, 13 Nov 2001 11:53:55 +1100 From: Gavin Cameron To: Chris Aitken Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Perl on FreeBSD Message-ID: <20011113005355.GA36434@mercury.itworks.com.au> References: <5.1.0.14.2.20011113111839.03949520@mail.ideal.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.1.0.14.2.20011113111839.03949520@mail.ideal.net.au> User-Agent: Mutt/1.3.23.2i 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 #!/usr/bin/perl -w while (<>) { print; } Transfers standard input to standard output. Replace print inside the while loop to do whatever you want. The line read in is stored in $_ in this example. Gavin On Tue, Nov 13, 2001 at 11:19:47AM +1100, Chris Aitken wrote: > Hi everyone.... > > > I have a curley on I havent been able to work out. > > What I want to be able to do is take the output of a FreeBSD command, and > pipe the output to a perl script so I can use that data.... > > For example. If I ran the following at command line, > > # echo "Blah Blah Blah" | perlscript.pl > > How would I be able to print "Blah Blah Blah" to the screen from the perl > script. I am only new to perl and have been doing alot of funky mrtg stuff > opening files and commands within the perl script and taking the output, > but im stumped on how to pipe data to a perl script and use that data in > the perl script. > > > Any assistance would be great. > > > > Thanks > > > Chris > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message