var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Programming newbie -help
Hi I am trying to learn shell script and i ran into an issue.
I am trying to read a file with few directories and tar them up.
I used a while loop but i end up overwriting tar file with only the last directory in the file being tared .
cat test.txt |
while read line
tar -czPf backup.tar.gz $line
If test.txt has test1, backup1, goo1
I end up having only goo1 in the tar
how do i get all 3 directories in the tar?
Thanks for your help in advance
tar -c create a new archive.
You should use tar -A to append to an existing archive, but it can't be done to add to a compressed archive.
Instead, you can use the following:
tar -czPf backup.tar.gz $(cat test.txt)