I have flat file containg relative file names in a given directory on a Unix box. I'd like to be able to tar up all these files using a loop that reads the file list. I have tried this but only get the last file name in the tar:
myFile="$HOME/Cleanup_Files.before"
myLine=""
while [ 1 ]; do
read myLine || break
tar -cvf cleanup_backup_files.tar $myLine
done < $myFile
Could someone let me know what I'm doing wrong? Like I said...I only have the last file in the .tar...not all the files in the list. Thanks!