From owner-freebsd-questions@FreeBSD.ORG Mon Feb 16 08:59:22 2004 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 DB90D16A4CF for ; Mon, 16 Feb 2004 08:59:22 -0800 (PST) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CBFA43D49 for ; Mon, 16 Feb 2004 08:59:22 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i1GGxHoH090218 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Feb 2004 16:59:17 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i1GGxHFC090217; Mon, 16 Feb 2004 16:59:17 GMT (envelope-from matthew) Date: Mon, 16 Feb 2004 16:59:17 +0000 From: Matthew Seaman To: Eric Toll Message-ID: <20040216165917.GA90010@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , Eric Toll , freebsd-questions@freebsd.org References: <9BC86C67C3AF7646B9C5382020457A940136C5@VIP10-WIN2K> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline In-Reply-To: <9BC86C67C3AF7646B9C5382020457A940136C5@VIP10-WIN2K> User-Agent: Mutt/1.5.6i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: freebsd-questions@freebsd.org Subject: Re: Scripts 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, 16 Feb 2004 16:59:23 -0000 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 16, 2004 at 11:40:56AM -0500, Eric Toll wrote: > I'm trying to feed a text file into a script. > Script is suppose to take relevant parts and output them to a new > file... > =20 > Script is marked executable... > =20 > =20 > less textfile | script.pl Usually you would do that by: % script.pl < textfile People often abuse cat(1) in this sort of case: it's the first time I've seen anyone do it with less. =20 > script.pl: Command not found. > =20 > What gives?? This typically means that the #! line in the script is incorrect -- for a perl script you need: #!/usr/bin/perl as the first line -- possibly with some extra flags. This assumes you actually have perl installed. perl-5.005.03 comes with the base system in 4.x, but in 5.x you have to install one of the perl ports -- perl-5.8.2 is now the default perl under 5.2 or above. In any case, remember to run the 'use.perl' script after installing or before de-installing a perl port. Nb. There are all sorts of weird ways of setting up the #! line of a perl script floating around the perl community, but those really are a waste of time on FreeBSD (or most modern unices for that matter). Stick with the tried and true simple way unless you have an overriding reason to do otherwise. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --Q68bSM7Ycu6FN28Q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAMPbldtESqEQa7a0RAiV5AJ0R18UgjyKk9UNoIkKC8kPHwdVBvgCfXcAx 0PA3VSSfCyE4z3fDCw1ogNk= =mP4G -----END PGP SIGNATURE----- --Q68bSM7Ycu6FN28Q--