我正在尝试构建一个shell脚本来监视一些日志文件.我正在使用这样的命令:
tail -f /var/somelog | grep --line-buffered " some test and p l a c e h o l d e r" | cut -f 3,4,14 -d " "
Run Code Online (Sandbox Code Playgroud)
日志文件如下:
some test and p l a c e h o l d e r 3
some test and p l a c e h o l d e r 4
some test and p l a c e h o l d e r 5
some test and p l …Run Code Online (Sandbox Code Playgroud)