Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Arglist too long...mv'ed crazy
- X-seq: zsh-users 11364
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Arglist too long...mv'ed crazy
- Date: Sun, 1 Apr 2007 18:28:03 +0100
- Cc: meino.cramer@xxxxxx, zsh-users@xxxxxxxxxx
- In-reply-to: <070401094909.ZM18282@xxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, meino.cramer@xxxxxx, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20070401021034.GA15269@solfire> <070331225824.ZM7614@xxxxxxxxxxxxxxxxxxxxxx> <070401094909.ZM18282@xxxxxxxxxxxxxxxxxxxxxx>
On Sun, Apr 01, 2007 at 09:49:09AM -0700, Bart Schaefer wrote:
[...]
> print -0 ../../cur/* | xargs -0 mv --target-directory=/back/up/folder
>
> (Note xargs, not zargs, in the latter case.)
My zsh doesn't seem to have a -0 print option.
Maybe print -f '%s\0' ...
Also, you may want to use xargs -r0
It should be noted that xargs -0 is GNU or BSD specific.
--target-directory is GNU specific.
> } zargs --replace -- ../../cur/* -- mv {} /back/up/folder
>
> That's probably the worst choice in this particular case because it
> will run "mv" once for each file, rather than once for each batch of
> as-many-files-will-fit.
zmodload zsh/files and mv becomes a builtin, so the problem
disappears along with eventual compatibility issues and you can
even do:
mv ../../cur/* /back/up/folder
You can also speed things up with:
mv ../../cur/*(oN) /back/up/folder
to prevent zsh from sorting the files which may not be necessary
here.
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author