awk - problem while printing matching line
I am trying to pass the matching line of a awk search command to some other program. I am doing something like
tail -f file | awk 'tolow开发者_如何学Cer($0) ~ /debug|.*nfo/ {system("java -jar abc.jar $0")}'
But am unable to pass the matching line to the external program.
IMO "java -jar abc.jar $0"
is a problem here; you have to concat this string:
tail -f file | awk 'tolower($0) ~ /debug|.*nfo/ {system("java -jar abc.jar " $0)}'
精彩评论