GNU bug report logs - #59533
BUG: files starting with "-" makes stat to say "invalid option -- 'S'" #64

Previous Next

Package: coreutils;

Reported by: Elias Tsolis <estatisticseu <at> gmail.com>

Date: Thu, 24 Nov 2022 08:57:01 UTC

Severity: normal

To reply to this bug, email your comments to 59533 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#59533; Package coreutils. (Thu, 24 Nov 2022 08:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Elias Tsolis <estatisticseu <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 24 Nov 2022 08:57:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Elias Tsolis <estatisticseu <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: BUG: files starting with "-" makes stat to say "invalid option --
 'S'" #64
Date: Wed, 23 Nov 2022 21:34:42 +0200
files starting with "-" makes stat to say "invalid option -- 'S'"

example, create a file "-fddsfdf.txt" and run "stat *" or "stat 
-fddsfdf.txt"

and then again , create a file "fddsfdf.txt" and run "stat *" or "stat 
fddsfdf.txt"

In first case, it will says "invalid option -- 'S'",
in second, it will be run normally.


No LSB modules are available.
Distributor ID:    Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:    11
Codename:    bullseye

stat (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


Information forwarded to bug-coreutils <at> gnu.org:
bug#59533; Package coreutils. (Thu, 24 Nov 2022 13:13:01 GMT) Full text and rfc822 format available.

Message #8 received at 59533 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Elias Tsolis <estatisticseu <at> gmail.com>, 59533 <at> debbugs.gnu.org
Subject: Re: bug#59533: BUG: files starting with "-" makes stat to say
 "invalid option -- 'S'" #64
Date: Thu, 24 Nov 2022 13:12:25 +0000
tag 59533 notabug
close 59533
stop

On 23/11/2022 19:34, Elias Tsolis wrote:
> files starting with "-" makes stat to say "invalid option -- 'S'"
> 
> example, create a file "-fddsfdf.txt" and run "stat *" or "stat
> -fddsfdf.txt"
> 
> and then again , create a file "fddsfdf.txt" and run "stat *" or "stat
> fddsfdf.txt"
> 
> In first case, it will says "invalid option -- 'S'",
> in second, it will be run normally.

This is usually handled with:
  stat ./-blah
  stat -- -blah

thanks,
Pádraig




This bug report was last modified 1 year and 346 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.