Re: piping find to zip -- with spaces in path
- From: Doug <dmcgarrett@xxxxxxxxxxxxx>
- Date: Tue, 11 Jan 2011 22:02:48 -0500
On 01/11/2011 08:46 PM, Robert Blair Mason Jr. wrote:
On Tue, 11 Jan 2011 14:53:33 -0700I didn't prune anything because I can't figure out where to do it without losing any semblance of coherence, but anyway:
Bob Proulx<bob@xxxxxxxxxx> wrote:
Robert Blair Mason Jr. wrote:True. Underscores are _wonderful_ things. But remember, Linux is Not Unix!Rob Owens<rowens@xxxxxxx> wrote:But that fails when the filename contains a quote character.I tried this and it successfully creates myfile.zip:I think the best way would be to quote them in the pipe:
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?
find ./ -iname "*.jpg" -printf "'%p'\n" | zip myfile -@
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
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...
The comment about real Unixers not using ascii characters: what about urls? They come from the Unix world, and are
full of underscores and question marks and equal signs. Then there are emails, all of which require the @ sign. Not
complaining, just asking.
--doug
--
Blessed are the peacemakers...for they shall be shot at from both sides. --A. M. Greeley
--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/4D2D19D8.3020807@xxxxxxxxxxxxx
- Follow-Ups:
- Re: piping find to zip -- with spaces in path
- From: Robert Blair Mason Jr.
- Re: piping find to zip -- with spaces in path
- 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
- Re: piping find to zip -- with spaces in path
- From: Robert Blair Mason Jr.
- piping find to zip -- with spaces in path
- Prev by Date: Re: piping find to zip -- with spaces in path
- Next by Date: Re (4): OpenVPN server mode usage.
- 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
|