title: Read list of files on unix and run command
body: <p>I am pretty new at shell scripting and I have been struggling all day to figure out how to perform a "for" command. Essentially, what I am trying to do is the following:</p>
  
  <p>I have a list.txt file with a bunch of names:</p>
  
  <pre><code>name1
  name2
  name3
  </code></pre>
  
  <p>for every name in the list, there are two different files, each with a different ending to the name. Ex:</p>
  
  <pre><code>name1_R1
  name1_R2
  </code></pre>
  
  <p>The program I am trying to run is called <code>sickle</code>. Basically, it takes two files (that correspond to each other) and runs an analysis on them, hence requiring me to have this naming scheme. The sickle command is as follow:</p>
  
  <pre><code>sickle pe -f input_file1.fastq -r input_file2.fastq -t sanger \
  </code></pre>
  
  <p>If someone could help me out, at least just by telling me how to get unix to read the list of files and treat each line independently I think I could go from there. I tried a few things, but none of them worked.</p>