From owner-freebsd-questions@freebsd.org Mon Oct 5 00:49:41 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 9D2F4A10B1D for ; Mon, 5 Oct 2015 00:49:41 +0000 (UTC) (envelope-from wam@hiwaay.net) Received: from fly.hiwaay.net (fly.hiwaay.net [216.180.54.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 563201DDB for ; Mon, 5 Oct 2015 00:49:41 +0000 (UTC) (envelope-from wam@hiwaay.net) Received: from kabini1.local (dynamic-216-186-213-32.knology.net [216.186.213.32] (may be forged)) (authenticated bits=0) by fly.hiwaay.net (8.13.8/8.13.8/fly) with ESMTP id t950ncAn013841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Sun, 4 Oct 2015 19:49:39 -0500 To: FreeBSD Questions !!!! From: "William A. Mahaffey III" Subject: awk question Message-ID: <5611C922.4050007@hiwaay.net> Date: Sun, 4 Oct 2015 19:55:08 -0453.75 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; 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 00:49:41 -0000 I am using awk & smartctl in a small shell script to print out HDD temps in a purty format, 1 line per drive. As it happens, the output I want is spread out over 4 lines of smartctl out, requiring (I *think*) 4 calls to smartctl each piped to its own awk invocation to pull out the line I want & print its info out. Is there some way to get awk to consider more than 1 line at a time ? In my case my 4 lines are indeed sequential, & it would be a bit more efficient if I could process all 4 lines once I found the 1st one. This is definitely *not* critical, what I have now works AOK, I was/am just curious if it could be optimized a bit. TIA & have a good one. -- William A. Mahaffey III ---------------------------------------------------------------------- "The M1 Garand is without doubt the finest implement of war ever devised by man." -- Gen. George S. Patton Jr.