Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!agate!helios.ee.lbl.gov!nosc!manta!psm From: psm@manta.NOSC.MIL (Scot Mcintosh) Newsgroups: comp.unix.questions Subject: many thanks for awk uppercase solutions(was: cascading pipes in awk) Keywords: awk Message-ID: <821@manta.NOSC.MIL> Date: 26 May 89 21:20:50 GMT Reply-To: psm@manta.nosc.mil.UUCP (Scot Mcintosh) Distribution: usa Organization: Naval Ocean Systems Center, San Diego Lines: 20 Thnaks to all who responded to my query about cascading pipes in awk (which soon became a discussion of how to convert text to uppercase in awk). The following submission is my favorite, because it's applicable to any kind of filter, not just tr. It also nicely illustrates the use of some awk features that were a little hazy to me even after reading the book. BEGIN { outcmd = "tr '[a-z]' '[A-Z]' >foobar" } { print $1 | outcmd } END { close(outcmd) while (getline x < "foobar") print x; }