[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: question re tar



On Tue, Sep 20, 2022 at 10:19:50PM +0100, jr wrote:
> hi,
> 
> On Tuesday, 20 September 2022 at 12:30:05 UTC+1, Greg Wooledge wrote:
> > ...
> > With this new information, it occurs to me that perhaps the OP did
> > something like this: ...
> > unicorn:/tmp/x$ find . | tar cv --files-from=- -f ../foo.tar
> 
> I prefer 'locate' to 'find'.  an no  guessing involved, as I wrote on
> the 18th, the invocation was:
>   $ tar -cvWf $arcname $fnames
> 
> where $fnames initially was a list in a variable (this is preparing a
> shell script), then I switched to storing in those in a file and
>   $ tar -cvWf $arcname $(cat $fname_list_file)

So... what's in these variables?  What's in the file pointed to by
the last variable?

In general, your approach of "storing a list in a string variable using
spaces and word splitting" is utterly crap and will NOT work with
arbitrary filenames.  Filenames can contain spaces and globbing
characters.

But that's probably not the main issue -- unless one of your filenames
happens to contain an asterisk or two.

It's just as likely that your "list" has duplicates in it.

If you'd show the content of those variables (and the file) maybe we
would know.


Reply to: