Are there objectively better ways to create temporary files in bash scripts?
I normally just name them whatever comes to my mind, such as tempfile-123, since it will
You might want to look at mktemp
The mktemp utility takes the given filename template and overwrites a portion of it to create a unique filename. The template may be any filename with some number of 'Xs' appended to it, for example /tmp/tfile.XXXXXXXXXX. The trailing 'Xs' are replaced with a combination of the current process number and random letters.
For more details: man mktemp