Path: utzoo!attcan!uunet!cs.utexas.edu!usc!ucsd!ogccse!littlei!omepd!merlyn From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.questions Subject: Re: Another sed question. Message-ID: <5310@omepd.UUCP> Date: 3 Dec 89 21:28:28 GMT References: <37091@ames.arc.nasa.gov> <1989Dec2.134348.22524@virtech.uucp> Sender: news@omepd.UUCP Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Hillsboro, Oregon, USA Lines: 23 In-reply-to: cpcahil@virtech.uucp (Conor P. Cahill) In article <1989Dec2.134348.22524@virtech.uucp>, cpcahil@virtech (Conor P. Cahill) writes: | Because the programmer wanted to do it that way. Lots of echos would have | been ugly, but a cat with here documents would have been just as clear and | probably as efficient. Just a nit... The "'cat' on a 'here' document method" must run over the data twice... once to create the file in /tmp that serves as the stdin, and once when cat reads that *as* stdin. That's a lot of overhead if the file is large. Also, you must ensure that you don't blow away the endmarker when you are editing the file, or the shell gets a bit confused. I like the "#!/bin/sed 1d" hack, but only when I'm trying to impress someone with another tricky use of #!, *or* I have to have a "program" put out constant text ("blurfl is no longer available... use the /etc/foobar/blurfl version instead!"). Just another UNIX hacker, -- /== Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ====\ | on contract to Intel's iWarp project, Hillsboro, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!uunet!iwarp.intel.com!merlyn | \== Cute Quote: "Welcome to Oregon... Home of the California Raisins!" ==/