delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/06/15/07:50:51

X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs
Date: Thu, 15 Jun 2000 13:28:33 +0200 (MET DST)
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
X-Sender: broeker AT acp3bf
To: djgpp-workers AT delorie DOT com
Subject: Re: "ls" bug ?
In-Reply-To: <200006151133.NAA01575@cerbere.u-strasbg.fr>
Message-ID: <Pine.LNX.4.10.10006151323030.7566-100000@acp3bf>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 15 Jun 2000, Pierre Muller wrote:

>   Doing "ls *.exe "
> 
> gives me invalid option -- .
[...]
> file with name -gstab.exe
> (note the leading minus !)

That's exactly your problem. ls *.exe expands to 'ls -gstab.exe'.
'ls' sees the '-' and thinks you're passing it options.

This is not a bug in ls, but a slightly incorrect way of using it. To pass
filenames beginning with '-' to any Unix-borne utility, you have to inform
it that these command line arguments are not options. The '--' options
does that:

	ls -- *.exe

will work.

Conclusion: don't use filenames beginning with a '-'.

Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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