From owner-freebsd-questions@FreeBSD.ORG Tue Mar 6 16:54:18 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D43D16A401 for ; Tue, 6 Mar 2007 16:54:18 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (dsl231-043-140.sea1.dsl.speakeasy.net [216.231.43.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0B90713C4B5 for ; Tue, 6 Mar 2007 16:54:17 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (localhost [127.0.0.1]) by tao.thought.org (8.13.8/8.13.1) with ESMTP id l26GroPE067944; Tue, 6 Mar 2007 08:53:50 -0800 (PST) (envelope-from kline@tao.thought.org) Received: (from kline@localhost) by tao.thought.org (8.13.8/8.13.1/Submit) id l26GroNc067943; Tue, 6 Mar 2007 08:53:50 -0800 (PST) (envelope-from kline) Date: Tue, 6 Mar 2007 08:53:49 -0800 From: Gary Kline To: Derek Ragona Message-ID: <20070306165349.GA67829@thought.org> References: <20070306003506.GA12553@thought.org> <6.0.0.22.2.20070306072709.02577448@mail.computinginnovations.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6.0.0.22.2.20070306072709.02577448@mail.computinginnovations.com> User-Agent: Mutt/1.4.2.2i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: Observing twenty years of service to the Unix community Cc: Gary Kline , FreeBSD Mailing List Subject: Re: awk question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2007 16:54:18 -0000 On Tue, Mar 06, 2007 at 07:27:56AM -0600, Derek Ragona wrote: > You can loop through them using a shell script: > for i in `ls -lt | awk '{if ($8 == 2006) print $9}'`;do rm $i;done This is the safest way to rm or rm -i each file ($i); the ls -ls | [awkstuff] spits out the entire list in one chunk. But since packages from 2006 were OLD, I just /bin/rm'd them wholesale. Thanks, gary > > -Derek > > > At 06:35 PM 3/5/2007, Gary Kline wrote: > > > Guys, > > > > Having found $9 , how do I /bin/rm it (using system()--yes??) > > in an awk one-liner? > > > > I'm trying to remove from packages from long ago and find and > > print them with > > > > ls -lt | awk '{if ($8 == 2006) print $9}'; > > > > but what I want to remove the file pointed at by $9. I've tried > > FILE=ARGV[9]; and using FILE within my system() call, but no-joy. > > What's the magic here? > > > > thanks in advance, > > > > gary > > > > > > > >-- > > Gary Kline kline@thought.org www.thought.org Public Service Unix > > > >_______________________________________________ > >freebsd-questions@freebsd.org mailing list > >http://lists.freebsd.org/mailman/listinfo/freebsd-questions > >To unsubscribe, send any mail to > >"freebsd-questions-unsubscribe@freebsd.org" > > > >-- > >This message has been scanned for viruses and > >dangerous content by MailScanner, and is > >believed to be clean. > >MailScanner thanks transtec Computers for their support. > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > MailScanner thanks transtec Computers for their support. > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" -- Gary Kline kline@thought.org www.thought.org Public Service Unix