Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!att!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.questions Subject: Re: cascading pipes in awk Summary: perl Message-ID: <8557@chinet.chi.il.us> Date: 26 May 89 03:18:39 GMT References: <813@manta.NOSC.MIL> <496@caldwr.UUCP> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Distribution: usa Organization: Chinet - Public Access Unix Lines: 26 In article <496@caldwr.UUCP> rfinch@caldwr.UUCP (Ralph Finch) writes: >> Is there a way to cascade pipes in awk? I'm trying to do something >> like the following: >> { print | "tr [a-z] [A-Z]" | <> now-upper-case text >> >> } >> >> Any other suggestions to accomplish the same thing would be >> appreciated. > >I'm also frustrated that awk doesn't allow the use of Unix utilities >inside of awk. And I'm amazed that no one has suggested using perl instead, since (a) it can run other programs via shell-like `prog ` expansion, but wouldn't need to in this case since (b) it has the tr as a built-in command, also named y as in sed. And, it comes with a utility to translate your awk program, although it has seldom worked for me because my awk programs tend to be written as shell "here documents" so some of the work can be done by other programs. BTW, does anyone know why such an inherently unix-ish concept as ` ` expansion was omitted from awk? Les Mikesell