I want to write a shell that runs until something is written to a file (by another process). I have written this:
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
but I get
test.sh: 3: test.sh: [0: not found
DONE