I've written a bash script based on this and this. The script is:
#!/bin/bash
until python data.py $1 $2 ; do
echo "'data.py' crashed with exit code $?. Restarting..." >> errors.txt
sleep 1
done
I run it:
./run.sh ‘a’ ‘n’
but in data.py
if sys.argv[1] == 'a':
returns false. How do I pass $1 and $2 to my Python program? TIA!!!
EDIT: SOLUTION
Thanks to Jandom and andlrc: I call it:
./run.sh "a" "n"
and change the script to:
until python data.py "$@" ; do