From owner-freebsd-questions@freebsd.org Mon Oct 5 09:35:56 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C79499A2B7 for ; Mon, 5 Oct 2015 09:35:56 +0000 (UTC) (envelope-from quartz@sneakertech.com) Received: from douhisi.pair.com (douhisi.pair.com [209.68.5.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E65769CD4 for ; Mon, 5 Oct 2015 09:35:55 +0000 (UTC) (envelope-from quartz@sneakertech.com) Received: from [10.2.2.1] (pool-108-49-223-195.bstnma.fios.verizon.net [108.49.223.195]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by douhisi.pair.com (Postfix) with ESMTPSA id 40D383F732 for ; Mon, 5 Oct 2015 05:35:54 -0400 (EDT) Message-ID: <56124479.9020505@sneakertech.com> Date: Mon, 05 Oct 2015 05:35:53 -0400 From: Quartz MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: awk question References: <5611C922.4050007@hiwaay.net> <20151005042129.1f153ec6.freebsd@edvax.de> <5611F776.9090701@hiwaay.net> In-Reply-To: <5611F776.9090701@hiwaay.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2015 09:35:56 -0000 > Funny you mention grep, I had a similar conversation on the NetBSD list > last week & everyone there suggested using awk alone to 'grep' out the > lines I wanted. Awk, sed, and various other utilities all have basic regex line matching, so if you're already calling them for some other feature then piping the output through grep first is kinda silly and inefficient. It's sorta like doing $(cat foo.txt | grep 'bar') instead of just $(grep 'bar' foo.txt). I suggested it mainly because it's easy to understand conceptually and because awk's syntax has something of a steep learning curve.