我想编写一个shell,它一直运行直到将某些内容写入文件(由另一个进程)。我写了这个:
PID_FILE=log.txt
DONE=0
while [$DONE -eq 0]
do
cat $PID_FILE | while read LINE
do
if [$LINE -neq ""]; then
echo "Do stuff here"
$DONE=1
fi
done
done
echo "DONE"
echo "">$PID_FILE
但我明白了
test.sh: 3: test.sh: [0: not found
DONE