Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Arglist too long...mv'ed crazy



A couple of other thing I meant to say, but forgot ...

On Mar 31, 10:58pm, Bart Schaefer wrote:
}
}     zargs -- ../../cur/* -- mv --target-directory=/back/up/folder

Any zargs call will probably still give a "too many arguments" error
unless you give it a -n option, because zargs is intended for use
with shell functions/builtins where no external argument length limit
is involved.  So I really should have suggested one of

  zargs -n100 -- ../../cur/* -- mv --target-directory=/back/up/folder

or

  print -0 ../../cur/* | xargs -0 mv --target-directory=/back/up/folder

(Note xargs, not zargs, in the latter case.)

}     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.  



Messages sorted by: Reverse Date, Date, Thread, Author