cascading pipes in awk

Leslie Mikesell les at chinet.chi.il.us
Fri May 26 13:18:39 AEST 1989


In article <496 at caldwr.UUCP> rfinch at 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]" | <<other stuff that will manipulate the
>> 				   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



More information about the Comp.unix.questions mailing list