cd `dirname $0` if [ -e problem_$1.tex ] then echo "$1 already exists" exit 0; fi cp problem_empty.tex problem_$1.tex echo "\\addproblem{$1}{}" >> problem-sort.tex git add problem_$1.tex #git add -u