cascading pipes in awk

Donald E. Hager hager at ksuvax1.cis.ksu.edu
Wed May 24 06:07:23 AEST 1989


In article <813 at manta.NOSC.MIL> psm at manta.nosc.mil.UUCP (Scot Mcintosh) 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've been reading this newsgroup for quite some time now, but I've never
posted before.  Here we go...

In reference to your <<other stuff...>> inside the awk program, I am
assuming that you are talking about more awk statements.  The problem
is that only one output statement to a pipe is permitted in an awk
program.  The solution that I see is to pipe your translated text into
an awk program:
	cat filename | tr [a-z] [A-Z] | awk '<<other stuff...>>'

I hope this helps!
--
Donald Hager					|    // //  =====   //   //
KSU Dept. of Computing & Information Sciences	|   // //  //___   //   //
Internet: hager at ksuvax1.cis.ksu.edu		|  //=<<      //  //   //
UUCP:  ...!{rutgers,texbell}!ksuvax1!hager	| //  //  =====   ======



More information about the Comp.unix.questions mailing list