title: How to create text file of dates when files in a directory were last edited
body: <p>I am trying to create a text file consisting of dates when all <code>.pzfx</code> files in a given directory were last edited. The big issue is that all the file names are not strings which complicates looping over them in a bash script.</p>
  <p>Here is the bash script I have so far:</p>
  <pre><code>#!/bin/bash
  
  find . -type f|grep .pzfx$ | while read file; do for i in &quot;$file&quot; stat -c ‘%y’ &quot;$file&quot; &gt;&gt; exp.dates.txt; done
  </code></pre>
  <p>When I run this I get the following error:</p>
  <pre><code>./date.sh: line 3: syntax error near unexpected token `&gt;&gt;'
  ./date.sh: line 3: `find . -type f|grep .pzfx$ | while read file; do for i in &quot;$file&quot; stat -c ‘%y’ &quot;$file&quot; &gt;&gt; exp.dates.txt; done'
  </code></pre>