小编And*_*lis的帖子

尾巴-f到grep切成不正常

我正在尝试构建一个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)

bash shell grep cut tail

17
推荐指数
1
解决办法
8395
查看次数

标签 统计

bash ×1

cut ×1

grep ×1

shell ×1

tail ×1