From owner-freebsd-questions@FreeBSD.ORG Tue Mar 6 00:46:36 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 182F716A401 for ; Tue, 6 Mar 2007 00:46:36 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by mx1.freebsd.org (Postfix) with ESMTP id 01B3513C461 for ; Tue, 6 Mar 2007 00:46:35 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from relay7.apple.com (a17-128-113-37.apple.com [17.128.113.37]) by mail-out4.apple.com (8.13.8/8.13.8) with ESMTP id l260kZPM022836; Mon, 5 Mar 2007 16:46:35 -0800 (PST) Received: from relay7.apple.com (unknown [127.0.0.1]) by relay7.apple.com (Symantec Mail Security) with ESMTP id BF41530081; Mon, 5 Mar 2007 16:46:35 -0800 (PST) X-AuditID: 11807125-a247bbb0000007df-c2-45ecb9eb8921 Received: from [17.214.13.96] (cswiger1.apple.com [17.214.13.96]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by relay7.apple.com (Apple SCV relay) with ESMTP id A4CC63000D; Mon, 5 Mar 2007 16:46:35 -0800 (PST) In-Reply-To: <20070306003506.GA12553@thought.org> References: <20070306003506.GA12553@thought.org> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <880C4678-6B40-44C7-A643-4F2FD9F35DBC@mac.com> Content-Transfer-Encoding: 7bit From: Chuck Swiger Date: Mon, 5 Mar 2007 16:46:35 -0800 To: Gary Kline X-Mailer: Apple Mail (2.752.2) X-Brightmail-Tracker: AAAAAA== Cc: 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 00:46:36 -0000 On Mar 5, 2007, at 4:35 PM, Gary Kline wrote: > Having found $9 , how do I /bin/rm it (using system()--yes??) > in an awk one-liner? I gather that you are looking under /var/db/pkg...? > 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? You could pipe the output of awk through "| xargs rm -rf"...but be careful. Putting it through "pkg_delete (-f)" might be safer. -- -Chuck