delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/28/07:03:06

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <4FF77D01E13B214590F4FA3E2C3021D0873ADB@pecos.csw.alewife.net>
From: Jared Ingersoll <jared AT cswv DOT com>
To: cygwin AT cygwin DOT com
Subject: RE: bash /usr/bin/ls invalid argument
Date: Tue, 28 Oct 2003 07:02:15 -0500
MIME-Version: 1.0
X-OriginalArrivalTime: 28 Oct 2003 12:02:15.0932 (UTC) FILETIME=[5452B3C0:01C39D4B]

Thanks, I thought it may be something inherent. I can work around this
limitation.

Jared

-----Original Message-----
From: Hannu E K Nevalainen [mailto:garbage_collector AT telia DOT com]
Sent: Tuesday, October 28, 2003 5:20 AM
To: cygwin AT cygwin DOT com
Subject: RE: bash /usr/bin/ls invalid argument


> From: Jared Ingersoll
> Sent: Monday, October 27, 2003 8:55 PM

> I'm using bash 2.05b-16 on Win2K pro and I'm running into problems listing
> directory contents with a wildcard. This particular directory has
> over 8000
> files in it, most of which (99%) are files that start with
> send.log.*. When
> I issue the following commands, I get the same error:
>
> $ ls send.log.*
> bash: /usr/bin/ls: Invalid argument

 For newbies: to get to grips about how this works "under the hood"; read up
on how "Shell expansion" works in e.g. bash (i.e. search and read the "man"
or "info" on bash)

 IIRC there was a recent thread (about environment variables and passing
arguments to a windows-console program):

There is a 32KB length limit on the command line. This is imposed on us by
the underlying "OS" - i.e. not likely to change.


To check how long your command line would be, try something like this:

$ find -type f -name 'send.log.*' |
(
  read f;
  cc=-1;
  echo "";
  while [ ! -z "$f" ];do
    cc=$(( 1 + $cc + $( echo "$f" | wc -c) ));
    echo -e "\e[F$cc\e[K";read f;
  done;
  echo -e "\e[F$cc chars"
)

Remember to add the length of e.g. "ls -l " (note space).

If this gives a number larger than...

$ echo $(( ( 1 << 15 ) -1 ))
32767

... then you're "outta luck".

/Hannu E K Nevalainen, B.Sc. EE - 59?16.37'N, 17?12.60'E
-- printf("Timezone: %s\n", (DST)?"UTC+02":"UTC+01"); --
--END OF MESSAGE--


--
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/

--
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