From owner-freebsd-questions Tue Nov 27 14:50:52 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.nbrewer.com (sparge.nbrewer.com [208.42.68.70]) by hub.freebsd.org (Postfix) with ESMTP id EFBED37B405 for ; Tue, 27 Nov 2001 14:50:48 -0800 (PST) Received: by mail.nbrewer.com (Postfix, from userid 1001) id 371174B71A1; Tue, 27 Nov 2001 16:50:48 -0600 (CST) Date: Tue, 27 Nov 2001 16:46:51 -0600 From: Christopher Farley To: Tony Subject: Re: removing last line Message-ID: <20011127164649.A92146@northernbrewer.com> References: <200111272155.NAA08579@idk.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200111272155.NAA08579@idk.com>; from tony@idk.com on Tue, Nov 27, 2001 at 01:55:43PM -0800 Organization: Northern Brewer, St. Paul, MN 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 Tony (tony@idk.com) wrote: > I need a way of removing just the last line in a text file using a csh > script. > > Any ideas? #!/bin/csh set count = `cat $1 | wc -l`; @ newcount = $count - 1; head -n $newcount $1 -- Christopher Farley www.northernbrewer.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message