🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.misc
Article #2018

Re: Operate on two files at the same time in awk

#2018
From: Randal L. Schwartz
Date: Fri, 08 Oct 1993 18:46
21 lines
1778 bytes
>>>>> In article <1993Oct6.221646.3864@bvl.pt>, vasco@bvl.pt (Antonio Vasconcelos) writes:
Antonio> But why one should use awk on this?

But why should one use *cat* here?

Antonio> cat file1 | awk '{print $1}' >x1
Antonio> cat file2 | awk '{print $1}' >x2

Sorry.  You struck my "unnecessary use of cat" nerve.

Get a clue, newbie script writers.  Cat with one parameter is *rarely*
needed.  For y'all, *never* is closer, but there are a few cases where
it might come in useful.

Grmph.

(And look, I didn't rewrite the script in Perl.  Tsk tsk. :-)
-- 
Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
merlyn@ora.com (semi-permanent) merlyn@agora.rain.com (for newsreading only)
phrase: "Welcome to Portland, Oregon ... home of the California Raisins!"
Technical Details
Message-ID: <MERLYN.93Oct8104613@agora.rain.com>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!asuvax!chnews!ornews.intel.com!percy!agora!merlyn
References: <1993Oct1.204112.6554@Princeton.EDU> <1993Oct6.221646.3864@bvl.pt>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f8c9b,be6d506f16d4e9f8
X-Google-Attributes: gidf8c9b,public
X-Google-Thread: f72b0,be6d506f16d4e9f8
X-Google-Attributes: gidf72b0,public
X-Google-Thread: 14b500,be6d506f16d4e9f8
X-Google-Attributes: gid14b500,public
X-Google-ArrivalTime: 1993-10-08 14:41:41 PST
Newsgroups: comp.unix.misc,comp.unix.questions,bnr.unix
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!asuvax!chnews!ornews.intel.com!percy!agora!merlyn
From: merlyn@ora.com (Randal L. Schwartz)
Subject: Re: Operate on two files at the same time in awk
In-Reply-To: vasco@bvl.pt's message of Wed, 6 Oct 1993 22:16:46 GMT
Message-ID: <MERLYN.93Oct8104613@agora.rain.com>
Sender: merlyn@agora.rain.com (Randal L. Schwartz)
Organization: Stonehenge Consulting Services; Portland, Oregon, USA
References: <1993Oct1.204112.6554@Princeton.EDU> <1993Oct6.221646.3864@bvl.pt>
Date: Fri, 8 Oct 1993 18:46:13 GMT
Lines: 21