title: Move and copy text file in bash script
body: <p>I referred to all the previous responses to this question from stackoverflow and tried out the following. But unfortunately, I am still encountering an issue.</p>
  
  <p>I have a text file named <code>Rels_obs</code> inside my directory <code>home/manuela/PycharmProjects/knowledgegraphidentification/data</code>. As the script runs, it extracts a <code>kgis.tar.gz</code> compressed folder and extracts it in the following manner. </p>
  
  <pre><code>#!/bin/bash
  
  readonly DATA_URL='https://linqs-data.soe.ucsc.edu/public/psl-examples-data/kgi.tar.gz'
  readonly DATA_FILE='kgis.tar.gz'
  readonly DATA_DIR='kgi'
  
  function main() {
     trap exit SIGINT
  
     check_requirements
  
     fetch_file "${DATA_URL}" "${DATA_FILE}" 'data'
     extract_tar "${DATA_FILE}" "${DATA_DIR}" 'data'
  }
  </code></pre>
  
  <p>The extraction results in two directories within the data directory found at <code>home/manuela/PycharmProjects/knowledgegraphidentification/data</code> :</p>
  
  <ul>
  <li>eval directory : <code>home/manuela/PycharmProjects/knowledgegraphidentification/data/kgi/eval</code></li>
  <li>learn directory : <code>home/manuela/PycharmProjects/knowledgegraphidentification/data/kgi/learn</code></li>
  </ul>
  
  <p>What I want to do is to copy my <code>Rels_obs</code> file to both of these newly available directories, <code>eval</code> and <code>learn</code>.</p>
  
  <p>I tried doing the following but it resulted in an error as shown below.</p>
  
  <pre><code>#!/bin/bash
  
  readonly DATA_URL='https://linqs-data.soe.ucsc.edu/public/psl-examples-data/kgi.tar.gz'
  readonly DATA_FILE='kgis.tar.gz'
  readonly DATA_DIR='kgi'
  
  function main() {
     trap exit SIGINT
  
     check_requirements
  
     fetch_file "${DATA_URL}" "${DATA_FILE}" 'data'
     extract_tar "${DATA_FILE}" "${DATA_DIR}" 'data'
  
     echo "COPYING"
  
     //I have only one file that is of plain text format within the data directory
  
     for file in ~/PycharmProjects/knowledgegraphidentification/data/*.txt
      do  
          name="$(basename "$file" .txt)"
          cp "$file" "~/PycharmProjects/knowledgegraphidentification/data/kgi/eval"
          cp "$file" "~/PycharmProjects/knowledgegraphidentification/data/kgi/learn"
      done
      echo "SUCCESSFULLY COPIED FILES"
  }
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>COPYING
    cp: cannot stat '/home/manuelanayantarajeyaraj/PycharmProjects/knowledgegraphidentification/data/<em>.txt': No such file or directory
    cp: cannot stat '/home/manuelanayantarajeyaraj/PycharmProjects/knowledgegraphidentification/data/</em>.txt': No such file or directory</p>
  </blockquote>
  
  <p><strong>ls -l on the data directory</strong></p>
  
  <pre><code>total 20524
  -rwxr-xr-x 1 manuelanayantarajeyaraj manuelanayantarajeyaraj     2210 
  Feb  5 15:19 fetchData.sh
  drwxrwxr-x 4 manuelanayantarajeyaraj manuelanayantarajeyaraj     4096 
  Nov 19  2017 kgi
  -rw-rw-r-- 1 manuelanayantarajeyaraj manuelanayantarajeyaraj 18546351 
  Feb  5 15:21 kgis.tar.gz
  -rw-rw-r-- 1 manuelanayantarajeyaraj manuelanayantarajeyaraj  2459319 
  Feb  5 13:31 Rels_obs
  </code></pre>
  
  <p>Any suggestions in this regard will be highly appreciated.</p>