From owner-freebsd-questions@FreeBSD.ORG Fri Feb 15 01:51:47 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9BE4DDBD for ; Fri, 15 Feb 2013 01:51:47 +0000 (UTC) (envelope-from perrin@apotheon.com) Received: from oproxy5-pub.bluehost.com (oproxy5-pub.bluehost.com [67.222.38.55]) by mx1.freebsd.org (Postfix) with SMTP id 740F4A54 for ; Fri, 15 Feb 2013 01:51:47 +0000 (UTC) Received: (qmail 5209 invoked by uid 0); 15 Feb 2013 01:44:45 -0000 Received: from unknown (HELO box543.bluehost.com) (74.220.219.143) by cpoproxy2.bluehost.com with SMTP; 15 Feb 2013 01:44:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=apotheon.com; s=default; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date; bh=9gnNMYNETnwXN4aEuwqFm4cXwpPu2a9XMID8vZknKB4=; b=cwhPk43uaMm40vTBJUbcA8MvvevXpOjU2TojJLW4OAvReJan9VJfvAOn5l0xWzIOki411t8R6l50X5ygBI2ZvLFL3gGxFz+cukRrzZ12O5pRxuk03sbEI1aOyc9GNU5L; Received: from [63.253.113.170] (port=53319 helo=localhost) by box543.bluehost.com with esmtpsa (TLSv1:CAMELLIA128-SHA:128) (Exim 4.80) (envelope-from ) id 1U6AM1-0002Lp-6d for freebsd-questions@freebsd.org; Thu, 14 Feb 2013 18:44:45 -0700 Date: Thu, 14 Feb 2013 18:44:43 -0700 From: Chad Perrin To: freebsd-questions@freebsd.org Subject: Re: Fun Scripting Problem Message-ID: <20130215014443.GA27962@hemlock.hydra> Mail-Followup-To: freebsd-questions@freebsd.org References: <511BDB13.3060005@tundraware.com> <201302132113.r1DLD6DX003167@mail.r-bonomi.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <201302132113.r1DLD6DX003167@mail.r-bonomi.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Identified-User: {2737:box543.bluehost.com:apotheon:apotheon.com} {sentby:smtp auth 63.253.113.170 authed with perrin@apotheon.com} X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2013 01:51:47 -0000 --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 13, 2013 at 03:13:06PM -0600, Robert Bonomi wrote: >=20 > here's a one-liner: > rm ` \ > stat -f "%SB %B %N" * \ > | sort -k5nr \ > | cut -c1-7,17-20,32- \ > | awk 'BEGIN {a=3D"";b=3D0;c=3D0} $1=3D=3Da && $2=3D=3Db && $3=3Dc {prin= t $4;}{a=3D$1;b=3D$2;c=3D$3}' \ I'm never comfortable calling something like that a "one-liner". If it runs over 80 columns of width, that (to me) doesn't really qualify as a one-liner. --=20 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --cNdxnHkX5QqsyA0e Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlEdkwsACgkQ9mn/Pj01uKVxFACguY8JdmjmOBd+HZ/BK7I6qCrA ra8AoKfy8oz1U+p4EpGu5eOpX4yEk869 =FhTA -----END PGP SIGNATURE----- --cNdxnHkX5QqsyA0e--