title: bash --redirect output to log file (with day date in the name)
body: <p>I just want to to redirect my script output to a file, to do so I try to redirect the output of a simple command and it works for a particular syntax and not for the other. Could you please have a look and give me any advice, Thanks in advance.
  Rgds,
  O.</p>
  
  <p>This one is working fine:</p>
  
  <pre><code>du -h &gt; "/var/log/mytst.$(date +%Y-%m-%d_%H:%M).log"
  </code></pre>
  
  <p>and this doesn't:</p>
  
  <pre><code>du -h &gt; /var/log/mytst."$(date +"%D--%H:%M:%S")".log 2&gt;&amp;1
  </code></pre>
  
  <p>Any idea? </p>