title: Bash script, redirect output to another directory
body: <p>I have an environment variable containing the name of a directory. I am trying to redirect output from an echo command to a text file in a different directory. </p>
  
  <p>For example</p>
  
  <pre><code>DIR="NewDirectory"
  mkdir $DIR
  echo "Testing" &gt;&gt; "$DIR\file.txt"
  </code></pre>
  
  <p>Results in a file named NewDirectory\file.txt in the working directory of the script...what exactly am I missing here? The directory is created without issue, so I am not sure what is going on here.</p>