I wrote a short bash script to complete a task that involves creating a temporary directory and storing various files in it and performing various operations on it.
In my first pass I just created the temp dir at /tmp/$$.$script", but then I tested the script on a computer where I didn't have write access to /tmp/, and I'd like to take that case into account. So my question is where's a good secondary location for this temp dir? Should I just use the current directory? The home directory? ~/tmp/? The output location of the script?
All created files do get cleaned up on script exit.