这就是我到目前为止我的问题是如何在脚本中添加所有日志文件的目录
#!/bin/bash
while true ; do
tail ~/Path
grep -o 'ERROR No appender named [MicromuseAppender] could be found' ' /dyn/logfiles/ (path)' &> /dyn/logfiles/.log
if [ $? -eq 0 ] ; then
echo Error found
break
fi
sleep 10
done
答案 0 :(得分:0)
转到目标文件夹并从所有文件中获取
grep 'ERROR No appender named [MicromuseAppender] could be found' $PATH/*
输出就像
<Filename>:<line which contains the grep'ed string>
仅获取文件名,其中错误字符串至少发生一次。
grep 'ERROR No appender named [MicromuseAppender] could be found' $PATH/* | cut -f1 -d: | sort | uniq