title: Find and rename files based on a mapping
body: <p>I am working on a linux cluster. I have a list of files that i need to find.</p>
  
  <pre><code>Sample10
  Sample22
  </code></pre>
  
  <p>These files have another serial number based naming convention.  A tab separated file <code>key.tsv</code> contains both names listed on a single row.</p>
  
  <pre><code>Sample10 Serial102
  Sample22 Serial120
  </code></pre>
  
  <p>I need to find the file by one name and link the file to another directory using its other ("Serial") name.  This is my attempt. </p>
  
  <pre><code>for i in "Sample10" "Sample22";
  do
      if [[ `find /directory/ -name $i*.fastq`]]
      then
      R1=$(find /directory/ -name $i*.fastq);
      ln -s $R1 /output/directory/"$i".fastq;
  else
      echo "File existence failed"
      fi
  done
  </code></pre>
  
  <p>This works to find the file of interest from the list and link it but i am stumped as to how rename them based on the entries in the key.</p>