On Mon, 21 Jun 2004, Doc Shipley wrote: >William L. Jarrold wrote: >> ...any idea how to avoid that "Argument list too long" >> error? I have been meaning to send a separate note about >> that problem for weeks now....Recent hacks have >> suggested that something like this might work... >> >> for i in ls ; do cp $i <cd-rom-incantation> ; done >> >> ...but a non-hack solution would be greatly appreciated. My perl >> is worse than my unix but I am v willing to try a perl soln but you'll >> have to be pretty explicit about what I am to do. > > man xargs > > /bin/ls * | xargs -J % cp -rp % destdir > > Should do about what you want.
That * will still expand to an argument list that is too long. Any reason not to use 'find ./'? I think OS X supports the -maxdepth flag if you don't want to recurse directories. Also, there's the '-ls' flag if you want to get an ls -l without using globbing or piping to xargs. Eric Irrgang - UT Austin ITS Unix Systems - (512)475-9342 _______________________________________________ Siglinux mailing list [EMAIL PROTECTED] http://machito.utacm.org/mailman/listinfo/siglinux
