title: use tee command to redirect output to a file in a non-existent dir
body: <p>I am trying to use the tee command to redirect output to a file, and I want the file to be created in a dir which is yet to be created.</p>
  
  <pre><code>date | tee new_dir/new_file
  </code></pre>
  
  <p>when new_dir is not there, the tee command fails saying</p>
  
  <blockquote>
    <p>tee: new_dir/new_file: No such file or directory</p>
  </blockquote>
  
  <p>If I create the new_dir prior to running the tee command, then it works fine, but for some reason I don't want to create the new_dir manually, is it possible to create the new_dir with the tee command ?</p>