#如果a.log文件中有timeout字眼,则输出true,如果没有则输出false,并把结果追加写入到result文件中
grep "timeout" a.log >/dev/null
if [ $? -eq 0 ]; then
echo "true"
echo "true" >>result
else
echo "false"
echo "false">>result
fi
2023-11-15 18:06:16
#如果a.log文件中有timeout字眼,则输出true,如果没有则输出false,并把结果追加写入到result文件中
grep "timeout" a.log >/dev/null
if [ $? -eq 0 ]; then
echo "true"
echo "true" >>result
else
echo "false"
echo "false">>result
fi