[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Awk, filtering match through external command

On Fri, Nov 09, 2012 at 03:47:15AM +0000, T o n g wrote:
> Hi, 
> Awk allows reading results from external command:
>  cmd | getline result

Over in comp.lang.awk they will tell you to avoid using getline if at
all possible because it changes the way your program operates in ways
that are difficult to anticipate.

> However, I want the cmd itself a piping command as well.  E.g.., 
>  "echo " substr($0, RSTART, RLENGTH) | command external with
>  parameters| 
> getline result
> Any way to make it works?

I'm not getting it. Perhaps you could post a sample input with the
desired output?


Reply to: