【发布时间】:2012-12-29 18:37:16
【问题描述】:
我正在做一个 scipt 来搜索一个有年龄的日志文件,并比较日志中谁有一个文本字符串,如果继续执行函数是正确的,但没有影响。我感谢任何建议或帮助
#!/bin/bash
file= find /AUX/backup/log/ -iname "*.log" -daystart -type f -mtime 1
if cat $file | grep -qw “INF - Status = completed."
then
echo "there is OK"
else
echo "there is KO"
fi
【问题讨论】:
标签: shell if-statement grep cat