我是新手,所以这似乎是一个愚蠢的问题,但我就是无法让这段代码正常工作。看起来 grep 正在寻找变量名而不是它的值。感谢任何帮助。
if [ "$file" == "osi_OpenInterest" ]
then
count=`cat timestamps.txt | grep "${file}" | grep "${currdate}" | grep "07:" | grep "AM" | wc -l`
if [ $count -eq 0 ];
then
echo "$file not found" | mail -s "RetrieverB Missing File" "$email"
fi
fi