I am creating temporary files from a bash script. I am deleting them at the end of the processing, but since the script is running for quite a long time, if I kill it or simply
I cannot believe that so many people assume that a file name will not contain a space. The world will crash if $TMPDIR is ever assigned to "temporary directory".
zTemp=$(mktemp --tmpdir "$(basename "$0")-XXX.ps")
trap "rm -f ${zTemp@Q}" EXIT
Spaces and other special characters like single quotes and carriage returns in file names should be considered in code as a requirement of decent programming habit.