title: How do I create a temporary directory using mktemp in my current working directory?
body: <p>I created a pipeline that strings multiple programs together, unfortunately these programs are creating a huge amount of temporary files in the <code>/tmp</code> folder and when using large datasets my pipeline crashes because the <code>/tmp</code> folder fills up.</p>
  
  <p>How do I export temporary files so that they are created in my current working directory where the pipeline is being run and not in the <code>/tmp</code> folder?</p>
  
  <p>Currently I have tried to export the <code>TMPDIR</code> env variable to an already created directory <code>/work</code> in my current working directory, but the temporary files are still being created in the <code>/tmp</code> folder:</p>
  
  <pre><code>export TMPDIR=$(mktemp -d --tmpdir=/work)
  &lt;script&gt;
  rm -rf $TMPDIR
  </code></pre>
  
  <p>The programs do not have the option to set different output folders for temporary files created.</p>