Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Mon, 25 Jul 2005 19:53:06 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Andy Fry cc: cygwin AT cygwin DOT com Subject: Re: MAX_ARG_PAGES In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 26 Jul 2005, Andy Fry wrote: > Hi, > > I'm executing a script and coming across the good old "Arg List too long" > problem. I can get round it using the find command, but since part of the > script does an scp of the file to another server, it's proving quite > intensive. i.e. it's making a separate scp connection for each file, rather > than one for the whole lot. What's wrong with xargs? Since scp doesn't allow the --target-directory (-t) argument of cp, you could do something like find . ... | xargs -r /bin/sh -c 'scp "$@" target_directory' DUMMY The above should copy substantially more than one file per connection, unless you have *really* long filenames. You do need the DUMMY parameter (or else you'll lose the first filename). > Under Linux I would tweak the MAX_ARG_PAGES to allow a larger Argument list. > Is it possible to do something similar on Cygwin ? And if so, how ? Not that I know of. IIRC, the argument list length limitation doesn't apply if Cygwin exec mechanisms are used, so if the above isn't good for you, try mounting the executable (scp?) with the -X option (see the mount man page for details). HTH, Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! If there's any real truth it's that the entire multidimensional infinity of the Universe is almost certainly being run by a bunch of maniacs. /DA -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/