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

Re: piping find to zip -- with spaces in path



Robert Blair Mason Jr. wrote:
> Rob Owens <rowens@ptd.net> wrote:
> > I tried this and it successfully creates myfile.zip:
> > 
> > find ./ -iname "*.jpg" -print | zip myfile -@
> > 
> > But it fails if there are spaces in the path or filename.  How can I
> > make it work with spaces?
> 
> I think the best way would be to quote them in the pipe:
> 
> find ./ -iname "*.jpg" -printf "'%p'\n" | zip myfile -@

But that fails when the filename contains a quote character.

  John's Important File

Using zero terminated strings (zstrings) are best for handling
arbitrary data in filenames.

Real Unix(TM) users never put [^[:ascii:]] characters in file names.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: