开发者

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)}'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜