I have the following bash script
for s in $(ls -1 fig/*.py); do
name=`basename $s .py`
if [ -e "fig/$name.pdf" -o "fig/$name.pdf" -ot "fig/$name.data" -ot "fig/$name.py" ]; then
$s
fi
done
It is supposed to invoke a python script if the output pdf does not exist, or the pdf is older than the py or data file.
Unfortunaly, the script is now never invoked. What did I do wrong?
EDIT
Thanks Benoit! My final script is:
for s in fig/*.py ; do # */ fix highlighting
name="$(basename "$s" .py)"
if test ! -e "fig/$name.pdf" -o "fig/$name.pdf" -ot "fig/$name.data" -o "fig/$name.pdf" -ot "fig/$name.py"
then
"$s"
fi
done