title: Concatenation in shell script and use of 'basename'
body: <p>I want to read all file names form a particular directory and then create new files with those names by appending some string to them in another directory.</p>
  
  <p>e.g > 'A', 'B', 'C' are in 'logs' directory
  then script should create 'A_tmp', 'B_tmp', 'C_tmp' in 'tmp' directory</p>
  
  <p>what i am using is - </p>
  
  <pre><code>tempDir=./tmp/
  logDir=./logs/
  
  for file in $( find `echo $logDir` -type f )
   do
        name=eval basename $file
        echo $name
        name=$(echo $name | sed 's/.$//')
        echo $tempDir
        opFile=$tempDir$name
        echo $opFile
   done
  </code></pre>
  
  <p>But what I understood is, $file is containing '\n' as last character and I am unable to concatenate the string.</p>
  
  <p>right now I am not creating files, just printing all the names.</p>
  
  <p>So, how I can remove the '\n' from the file name, and is my understanding correct ?</p>