title: bash: How to properly read/assign multiple lines to variables from text file
body: <p>I apologize if this is a duplicate but I have not found a good answer yet.
  I have a text file that contains three paths, each as a new line:</p>
  
  <pre><code>path1
  path2
  path3
  </code></pre>
  
  <p>I want to assign these paths to three variables. When I read in the text file and assign these three paths to three variables, the first variable gets correctly assigned to path1 but not the second/third, and the first variable gets re-assigned to the path2. Both second/third variables are always empty (possibly line breaks?)</p>
  
  <pre><code>while read -r a b c; do
      echo first_path is $a
      echo second_path is $b
      echo third_path is $c
  done &lt; ./ready.txt
  </code></pre>
  
  <p>the output is </p>
  
  <pre><code>first_path is path1
  second_path is
  third_path is
  first_path is path2
  second_path is
  third_path is
  </code></pre>
  
  <p>It must be a simple mistake. Any help is appreciated. Thank you.</p>