title: Problems with basename in a loop
body: <p>I am new at shell script programming and I'm trying to execute a software that reads a text and perform it's POS tagging. It requires an input and an output, as can be seen in the execute example:</p>
  
  <pre><code>$ cat input.txt | /path/to/tagger/run-Tagger.sh &gt; output.txt
  </code></pre>
  
  <p>What I'm trying to do is to execute this line not only for a text, but a set of texts in an specific folder, and return the output files with the same name as the input files. So, I tried to do this script:</p>
  
  <pre><code>#!/bin/bash
  path="/home/rafaeldaddio/Documents/"
  program="/home/rafaeldaddio/Documents/LX-Tagger/POSTagger/Tagger/run-Tagger.sh"
  
  for arqin in '/home/rafaeldaddio/Documents/teste/*'
  do
  out=$(basename $arqin)
  output=$path$out
  cat $arqin | $program &gt; $output
  done
  </code></pre>
  
  <p>I tried it with only one file and it works, but when I try with more than one, I get this error:</p>
  
  <pre><code>basename: extra operand ‘/home/rafaeldaddio/Documents/teste/3’
  Try 'basename --help' for more information.
  
  ./scriptLXTagger.sh: 12: ./scriptLXTagger.sh: cannot create /home/rafaeldaddio/Documents/: Is a directory
  </code></pre>
  
  <p>Any insights on what I'm doing wrong? Thanks.</p>