title: How to pass a variable to the mv command to rename a file text with spaces and the variable's text in a bash (.sh) file
body: <p>I create a variable and store the day, date &amp; time in it:</p>
  
  <pre><code>NOW=$(date "+%a %d/%m/%Y% %H:%M")
  </code></pre>
  
  <p>Then I would like to pass <code>$NOW</code> to the <code>mv</code> command to rename a file.</p>
  
  <p>e.g. Create file named a.txt with a title and the current date:</p>
  
  <pre><code>printf "File Report (" &gt; ~/Desktop/a.txt
  echo $NOW"):\n" &gt;&gt; ~/Desktop/a.txt  
  </code></pre>
  
  <p>Then I try to rename the file with the variable ($NOW) included in the name:</p>
  
  <pre><code>mv ~/Desktop/a.txt ~/Desktop/'File Report $NOW'.txt
  </code></pre>
  
  <p>What should that last line be? I also tried these two options.</p>
  
  <pre><code>mv ~/Desktop/a.txt ~/Desktop/'File Report' $NOW.txt
  </code></pre>
  
  <p>&amp;</p>
  
  <pre><code>mv ~/Desktop/a.txt ~/Desktop/'File Report'${NOW}.txt
  </code></pre>