Re: How to create a tar + gzip from a listing of file names.



2007-01-25, 18:56(+08), Bo Yang:
[...]
Does the following code works for you ?

tar cvf BKUPTST_$DATE.tar $(sed 's/\n/ /g' < archive.lst)

$(....) splits upon space, tabs and newlines by default and also
expands the wildcards. So you don't need to convert newlines to
spaces. You should rather make sure $(...) only splits on
newlines, and doesn't expand the wildcards:

IFS='
'
set -f

--
Stéphane
.



Relevant Pages