Rather than shelling out to two piped commands, it's probably easier to do the whole thing in perl.
Correct me if I'm wrong (I stopped using awk after I discovered perl), but it seems like you are looking for lines in a file that match some string, and collecting the third field from each found line?
Code:
use strict;
use warnings;
while (<>) {
print split($_)[3], "\n" if (/string/);
}
Might do it. (Untested)
Steve
[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object:erlDesignPatterns)[/small]
[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object:erlDesignPatterns)[/small]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.