title: Bash - Using "find" in while loop is giving blank results with input from DOS text file
body: <p>I have a text file that contains a list of file names without the folder path or extension. I want to loop over this file and find the path that matches the file name. However, my find command inside the while loop is not giving me the result. The find command works when I take it out of the while loop.</p>
  
  <p>Here is my example input file (input.txt):</p>
  
  <pre><code>12345
  56789
  ...
  09987
  89008
  </code></pre>
  
  <p>The actual files are stored like this:</p>
  
  <pre><code>/home/user/path/to/file/12345.jpg
  </code></pre>
  
  <p>Here is my script (find_files.sh):</p>
  
  <pre><code>#!/bin/bash
  while IFS= read -r line || [[ -n "$line" ]]; do
      echo $line
      file=$(find /home/engage/ -name "${line}*" -print)
      echo $file
  done &lt; "$1"
  </code></pre>
  
  <p>And I'm calling it with:</p>
  
  <pre><code>./find_files.sh input.txt
  </code></pre>
  
  <p>The output I'm getting is this:</p>
  
  <pre><code>12345
  
  56789
  ...
  09987
  
  89008
  </code></pre>
  
  <p>So <code>find</code> is not getting any results. What am I doing wrong? Thanks!</p>