GNU bug report logs -
#8513
stat list file name
Previous Next
Reported by: - - <wififu <at> gmail.com>
Date: Sun, 17 Apr 2011 02:54:02 UTC
Severity: normal
Done: Bob Proulx <bob <at> proulx.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#8513: stat list file name
which was filed against the coreutils package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 8513 <at> debbugs.gnu.org.
--
8513: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8513
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
- - wrote:
> here a small bug in stat:
>
> stat -c %n *
> stat : option invalide -- 's'
> Saisissez « stat --help » pour plus d'informations.
>
> ls
> -sdjfè`@$&.txt
>
> stat is not able to list a direstory if a file start with a -
Thank you for your bug report but this is not a bug in stat but a
misunderstanding of how file globs operate with your command shell.
The '*' on your command line is expanded by the shell to all of the
files in the directory. You have a filename that starts with a dash.
The resulting command line is the same as if you had placed the dash
on the command line yourself.
You can see this by using 'echo' to print out the command.
$ echo stat -c %n *
echo stat -c %n -sdjfè`@$&.txt
As you can see by using echo there is no difference between having a
file starting with a dash and placing an option with a dash on the
command line. The only way to tell is for you to invoke the command
without the ambiguity. Either use ./* to avoid having filenames start
with a dash or use "--" to signal to the command that there are no
further options.
Either:
$ stat -c %n ./*
Or:
$ stat -c %n -- *
Bob
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
here a small bug in stat:
stat -c %n *
stat : option invalide -- 's'
Saisissez « stat --help » pour plus d'informations.
ls
-sdjfè`@$&.txt
stat is not able to list a direstory if a file start with a -
[Message part 5 (text/html, inline)]
This bug report was last modified 14 years and 99 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.