title: How Can I filter by file name in Automator by Shell Script?
body: <p>I want to filtering by file name in Automator by Shell Script.
  If I use this example it is work in correctly.</p>
  <pre><code># Example (Filtering .wav files in ShellScript)
  while read line; do
  if expr &quot;$line&quot; : &quot;.*.wav$&quot; &gt; /dev/null
  then
      echo &quot;$line&quot; &gt;&amp;1
  fi
  done
  </code></pre>
  <p>How can I filter by the any keywords in filename.</p>
  <p>(Example)</p>
  <p>files in folder</p>
  <ul>
  <li>banana03284204</li>
  <li>banana39538539</li>
  <li>orange38053054</li>
  <li>orange35000382</li>
  <li>dog890938329</li>
  <li>cat349423942</li>
  </ul>
  <p>I want to get files that contain &quot;orange&quot; from these files.</p>
  <p>(Add Info)</p>
  <p>The reason of I am using Shell Script, It is hard to success filtering files in NAS (Network Attached Storage)
  For NAS files, Automator functions is failed.
  I tried to add command to connect server in Automator.but failed.</p>