I don't think that's quite right; Even if the file is deleted, wouldn't it just be recreated if there was any output from the mutex command?
#!/bin/sh
rm yadda
touch yadda
(sleep 1; echo something >> yadda) &
rm yadda
if [ -f yadda ]; then
echo "file exists"
else
echo "file doesn't exist"
fi
sleep 1
cat yadda
I don't think that's quite right; Even if the file is deleted, wouldn't it just be recreated if there was any output from the mutex command?
#!/bin/sh
rm yadda
touch yadda
(sleep 1; echo something >> yadda) &
rm yadda
if [ -f yadda ]; then
echo "file exists"
else
echo "file doesn't exist"
fi
sleep 1
cat yadda