It would nice if the script was modified to error and quit if either
mkdir tmp
cd tmp
fails. As written, if the current directory has a file named tmp, the mkdir silently fails, the cd fails, and the script proceeds with an eventual call to rm *.
I recommend at least changing
mkdir tmp
cd tmp
to
mkdir tmp || exit 1
cd tmp || exit 2
|