Re: piping find to zip -- with spaces in path
- From: "Robert Blair Mason Jr." <rbmj@xxxxxxxxxxx>
- Date: Tue, 11 Jan 2011 20:46:44 -0500
On Tue, 11 Jan 2011 14:53:33 -0700
Bob Proulx <bob@xxxxxxxxxx> wrote:
Robert Blair Mason Jr. wrote:
Rob Owens <rowens@xxxxxxx> 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
True. Underscores are _wonderful_ things. But remember, Linux is Not Unix!
Unfortunately for the OP, i don't *think* zip accepts zstrings. Perhaps a script to just remove all of the non-ascii characters in the filename of all files in the current directory?
Random tangent, but pascal strings are often more efficient from a programming standpoint than c-style strings...
--
rbmj
--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/20110111204644.3a58aa9c@xxxxxxxxxxxxxxxxxx
- Follow-Ups:
- References:
- piping find to zip -- with spaces in path
- From: Rob Owens
- Re: piping find to zip -- with spaces in path
- From: Robert Blair Mason Jr.
- Re: piping find to zip -- with spaces in path
- From: Bob Proulx
- piping find to zip -- with spaces in path
- Prev by Date: Re: piping find to zip -- with spaces in path
- Next by Date: Re: piping find to zip -- with spaces in path
- Previous by thread: Re: piping find to zip -- with spaces in path
- Next by thread: Re: piping find to zip -- with spaces in path
- Index(es):
Relevant Pages
|