title: How to read a file and copy from one file to another file in shell script
body: <p>How to read a file and copy from one file to another file in shell script:</p>
  
  <pre><code>#!/bin/csh -f
  echo ---file.txt---
  cat file.txt
  
  echo ######## file.text is opened ########
  #set file_1="export/home/caratins/trial/file.txt"
  while read line
  do
  echo "$line"
  cp file.txt files
  
  done&lt;file.txt
  </code></pre>
  
  <p>Actually one folder trial is there, inside trial folder 4 text files are there. I want to open a file-'file.txt'. Inside file.txt 3 files names are there: test1.txt, test2.txt, test3.txt. My work is using file.txt file I have read all 3 files names and copy it to another folder. So for that I have to open file.txt, read the file and print 3 files and only copy these 3 files not full folder and copy these 3 files to another folder'files' which is in same directory.</p>