title: Sed replace date
body: <p>So, I have looked over other questions and nothing specific seems like it can help me.  I have a file that has a date variable set like mm/dd/yyyy that I would like to replace the date with.</p>
  
  <p>For example:</p>
  
  <p>version.js</p>
  
  <pre><code>//Application Version Information
  app_date="7/07/2015";
  ...
  </code></pre>
  
  <p>And I would like to use sed to replace it.  I actually have a shell script that replaces many things in this file, and all work except for the date.  Currently what I'm trying is:</p>
  
  <pre><code>sed -i -e 's:app_date="[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]":app_date="$(date %m/%d/%Y)":g'
  </code></pre>
  
  <p>But this isn't getting me the results I want.  I've also tried:</p>
  
  <pre><code>sed -ibak 's/app_date=\"[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9][0-9][0-9]\"/app_date=\$(date +%m/%d/$Y)\"/g'
  </code></pre>
  
  <p>Neither seem to work.</p>
  
  <p>Any ideas?</p>
  
  <p>Edited to add:</p>
  
  <p>The solution I've successfully employed is Sean Bright's with double quotes:</p>
  
  <pre><code>sed -i -e "s:app_date=".*";:app_date="$(date +%m/%d/%Y)";:g" version.js
  </code></pre>
  
  <p>This works perfectly for my needs.  </p>