nlog=0
for i in "$logdir/$tag".*; do
if [ ! -f "$i" ]; then continue; fi
- nlog=$(( nlog + 1 ))
+ nlog=$(( $nlog + 1 ))
done
## If there are too many, go through and delete some early ones.
if [ $nlog -gt $maxlog ]; then
- n=$(( nlog - maxlog ))
+ n=$(( $nlog - $maxlog ))
for i in "$logdir/$tag".*; do
if [ ! -f "$i" ]; then continue; fi
rm -f "$i"
- n=$(( n - 1 ))
+ n=$(( $n - 1 ))
if [ $n -eq 0 ]; then break; fi
done
fi