title: Basename in GNU Parallel
body: <p>I have hundreds of files, named as follows:</p>
  
  <p>RG1-t.txt</p>
  
  <p>RG1-n.txt</p>
  
  <p>RG2-t.txt</p>
  
  <p>RG2-n.txt</p>
  
  <p>etc...</p>
  
  <p>I would like to use GNU parallel to run scripts on them, but I struggle to get the basenames of the files, so RG1, RG2 etc... so that I can run:</p>
  
  <pre><code>ls RG*.txt | parallel "command.sh {basename}-t.txt {basename}-n.txt &gt; {basename}.out"
  </code></pre>
  
  <p>resulting in the files RG1.out, RG2.out etc. 
  Any ideas?</p>