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

2022-11-24 Thread Pádraig Brady

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





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

2022-11-24 Thread Elias Tsolis

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 
.

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.