<p>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.</p>

<p>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?</p>

<p>All created files do get cleaned up on script exit.</p>

You could try
```
/var/tmp
```
, although it's likely that
```
/tmp
```
is a symlink to that (or vice-versa).