delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/25/19:53:19

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Andy Fry <andy DOT fry AT essential DOT com DOT au>
cc: cygwin AT cygwin DOT com
Subject: Re: MAX_ARG_PAGES
In-Reply-To: <C316306FDC7ED511BC2C00D0B789CD9E02CC93DA@fox.essential.com.au>
Message-ID: <Pine.GSO.4.61.0507251941570.21536@slinky.cs.nyu.edu>
References: <C316306FDC7ED511BC2C00D0B789CD9E02CC93DA AT fox DOT essential DOT com DOT au>
MIME-Version: 1.0

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019