title: for loop calling two different files (same name, different extension) across several files
body: <p>I have several files. I need to run a <em>perl</em> script calling all the files in a folder, simultaneously calling one file with extension <em>.pep</em> and another that is a similar file and matches the same name but different extension, <em>.pep.nuc</em> (like <code>Oh01.pep</code> and <code>Oh001.pep.nuc</code>)</p>
  
  <p>I have this script so far, but I am missing something of course.</p>
  
  <pre><code>for file *.pep; do ./script.pl  *.pep *.pep.nuc &gt; "${file%.*}.nucleo"; done   
  </code></pre>