Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!ihlpf!lukas From: lukas@ihlpf.ATT.COM (00771g-Lukas) Newsgroups: comp.unix.questions Subject: Re: many thanks for awk uppercase solutions(was: cascading pipes in awk) Keywords: awk Message-ID: <8638@ihlpf.ATT.COM> Date: 31 May 89 18:04:02 GMT References: <821@manta.NOSC.MIL> Reply-To: lukas@ihlpf.UUCP (00771g-Lukas,J.) Distribution: usa Organization: AT&T Network Systems - Lisle Illinois Lines: 33 In article <821@manta.NOSC.MIL> psm@manta.nosc.mil.UUCP (Scot Mcintosh) writes: >BEGIN { > outcmd = "tr '[a-z]' '[A-Z]' >foobar" > } > { > print $1 | outcmd > } >END { > close(outcmd) > while (getline x < "foobar") > print x; > } There is no real need to use file "foobar" (unless you want it). This will also work, and save some complexity: BEGIN { outcmd = "tr '[a-z]' '[A-Z]'" } { print $1 | outcmd } If you wanted "foobar", you could tack " | tee foobar" on the end of outcmd. To get even simpler, you could get rid of outcmd completely with { print $1 | "tr '[a-z]' '[A-Z]'" } -- John Lukas att!ihlpf!lukas 312-510-6290