From owner-freebsd-questions@FreeBSD.ORG Fri Mar 9 18:47:32 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 1200916A403 for ; Fri, 9 Mar 2007 18:47:32 +0000 (UTC) (envelope-from gs_stoller@juno.com) Received: from outbound-mail.nyc.untd.com (outbound-mail.nyc.untd.com [64.136.20.164]) by mx1.freebsd.org (Postfix) with SMTP id 9B6EF13C4A3 for ; Fri, 9 Mar 2007 18:47:31 +0000 (UTC) (envelope-from gs_stoller@juno.com) Received: from webmail22.nyc.untd.com (webmail22.nyc.untd.com [10.141.27.162]) by smtpout02.nyc.untd.com with SMTP id AABC9DL7YAHSWKF2 for (sender ); Fri, 9 Mar 2007 10:47:18 -0800 (PST) X-UNTD-OriginStamp: /s5f1SIGSI3+WdnoYQ8yRCfFQXXcOGooa0nodOD1XqlFmO/bZuKjUA== Received: (from gs_stoller@juno.com) by webmail22.nyc.untd.com (jqueuemail) id MGEPF2ER; Fri, 09 Mar 2007 10:46:50 PST Received: from [71.251.0.101] by webmail22.nyc.untd.com with HTTP: Fri, 9 Mar 2007 18:46:22 GMT X-Originating-IP: [71.251.0.101] Mime-Version: 1.0 From: "gs_stoller@juno.com" Date: Fri, 9 Mar 2007 18:46:22 GMT To: derek@computinginnovations.com, kline@tao.thought.org X-Mailer: Webmail Version 4.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Content-Type: text/plain Message-Id: <20070309.104650.775.601090@webmail22.nyc.untd.com> X-ContentStamp: 2:2:4231369790 X-UNTD-Peer-Info: 10.141.27.162|webmail22.nyc.untd.com|webmail22.nyc.untd.com|gs_stoller@juno.com Cc: freebsd-questions@freebsd.org 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: Fri, 09 Mar 2007 18:47:32 -0000 You are trying to remove the files whose names are given by ls -lt | awk '{if ($8 =3D=3D 2006) print $9}'; If you are in the same directory, or you have full pathnames, you can do just (and avoid the 'for do done' loop) rm $( ls -lt | awk '{if ($8 =3D=3D 2006) print $9}' ) If this exceeds the maximum length of a line, just use xargs also.