This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MAX_ARG_PAGES


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@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]