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

Re: Awk, filtering match through external command



On Thu, 08 Nov 2012 23:29:23 -0500, John L. Cunningham wrote:

>> However, I want the cmd itself a piping command as well.  E.g..,
>> 
>>  "echo " substr($0, RSTART, RLENGTH) | command external with
>>  parameters|
>> getline result
>> 
> I'm not getting it. Perhaps you could post a sample input with the
> desired output?

*For the sake of illustration of filtering through external command*: 

It's OK to:

 head /etc/group | awk '{print $0 | "cut -d':' -f1";}'

or, 

 head /etc/group | awk '{ "echo " $0 | getline result ; print result}'

Any way to filter through external command to variable, somewhat like:

 head /etc/group | awk '{print $0 | "cut -d':' -f1" | getline result ;}'

Any way to make it works?

Thanks


Reply to: