From owner-freebsd-questions@FreeBSD.ORG Tue Mar 6 13:28:54 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 565E116A402 for ; Tue, 6 Mar 2007 13:28:54 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from betty.computinginnovations.com (dsl081-227-250.chi1.dsl.speakeasy.net [64.81.227.250]) by mx1.freebsd.org (Postfix) with ESMTP id C761313C441 for ; Tue, 6 Mar 2007 13:28:51 +0000 (UTC) (envelope-from derek@computinginnovations.com) Received: from p28.computinginnovations.com (dhcp-10-20-30-100.computinginnovations.com [10.20.30.100]) (authenticated bits=0) by betty.computinginnovations.com (8.13.8/8.12.11) with ESMTP id l26DSBwJ040438; Tue, 6 Mar 2007 07:28:13 -0600 (CST) Message-Id: <6.0.0.22.2.20070306072709.02577448@mail.computinginnovations.com> X-Sender: derek@mail.computinginnovations.com X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Tue, 06 Mar 2007 07:27:56 -0600 To: Gary Kline , FreeBSD Mailing List From: Derek Ragona In-Reply-To: <20070306003506.GA12553@thought.org> References: <20070306003506.GA12553@thought.org> Mime-Version: 1.0 X-ComputingInnovations-MailScanner-Information: Please contact the ISP for more information X-ComputingInnovations-MailScanner: Found to be clean X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com X-Spam-Status: No Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: 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 13:28:54 -0000 You can loop through them using a shell script: for i in `ls -lt | awk '{if ($8 == 2006) print $9}'`;do rm $i;done -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.