long command lines

David M. Karr dkarr@tcsi.com
Thu Jan 25 16:45:00 GMT 2001

>>>>> "Mike" == Mike Schuster <schuster@nuance.com> writes:
  Mike> Problem: I couldn't figure out how to get very long command line
  Mike> arguments to work (~32k) (for example 'ls */*/*/*', if you have a lot of
  Mike> files on the disk).

  Mike> Question: Does anybody know if this
  Mike>   a) a Windows problem,
  Mike>   b) a cygwin problem,
  Mike>   c) something that can easily be fixed by setting some parameter
  Mike> (Which?).

Before, when I only worked on Unix (with Ksh, NOT Csh), I used to use
command lines like this all the time:

    somecmd $(find . -type f)

When I started needing to do similar things on Cygwin, I discovered
the line length problem, and concluded there was no "fix" for it.

The only way (others?) to deal with this is to break up commands like
the latter into something like this:

    find . -type f | xargs -n100 somecmd

Depending on what "somecmd" is, and the average length of your file
names, you might have to use less than 100 per command, or going the
other direction, you could get away with using more per command.

Fortunately, using this strategy is still portable back up to Unix.

David M. Karr     ; w:(425)487-8312     ; TCSI & Best Consulting
dkarr@tcsi.com    ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)

Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

More information about the Cygwin mailing list