title: Set file modification time from the date string present in the filename
body: <p>I'm restoring a number of archives with dates within their names, something along the lines of:</p>
  
  <pre><code>user-2018.12.20.tar.xz
  user-2019.01.10.tar.xz
  user-2019.02.25.tar.xz
  user-2019.04.19.tar.xz
  ...
  </code></pre>
  
  <p>I want to set each file's modification date to match the date in their filename by piping the filenames to <code>touch</code> via <code>xargs</code> and using <code>replace-str</code> to set the dates.</p>
  
  <p><code>touch -m -t</code> will take a datetime in the format <code>[CCYYMMDDhhmm]</code>, but I'm having trouble substituting inline:</p>
  
  <pre><code>find . -name "*.xz" | xargs -I {} touch -m -t $(sed -e 's/\.tar\.xz//g; s/user-//g; s/\.//g; s/\///g; s/$/0000/g' {}) {}
  </code></pre>
  
  <p>Returns <code>touch: invalid date format ‘./user-2018.03.22.tar.xz’</code>, even though this:</p>
  
  <pre><code>find . -name "*.xz" | sed -e 's/\.tar\.xz//g; s/user-//g; s/\.//g; s/\///g; s/$/0000/g'
  </code></pre>
  
  <p>Returns properly-formatted dates, for example <code>201812200000</code>. Am I misusing command substitution in my replace string somehow?</p>
  
  <p><strong>EDIT :</strong> Yes, a simple script could do this no problem. But the question remains...</p>