Todd -- ...and then Todd Geders said... % % If you have a filename beginning with a "dash" such as '-test.png' and you
If you have a filename beginning with a "dash" then you have to work around it, just like you have to work around an embedded space (try cd /path/to/scratch/dir touch "this is a test" ls *test and see) or any other "special" character. % attempt to 'ls *.png' you get the following error: % % $ ls *.png % ls: invalid option -- e % Try `ls --help' for more information. % % $ ls | grep png % -test.png That will do it. When you specify "*.png" your shell expands that to -test.png (and would tack any other files on there if they were present). What ls sees is ls -test.png which, of course, is the 'ls' command with the option flag '-t' and the argument to that 'est.png' -- and the --help output clearly says -t sort by modification time without allowing for any other arguments. % % This is with GNU fileuitls version 4.1.11 on a GNU/Linux machine running % Gentoo Linux 1.2 with gcc 2.95.3. Have not been able to test on other % distribution. AFAIK, the only forbidden characters are / and NULL, so I Well, not so much 'forbidden', but certainly less than wise. % believe it is a bug. Nope. An old trick on new users, in fact :-) Look for '--' in the docs. For some fun, try cd / touch ./-rR ls * and figure out why your reverse-sorted listing goes on and on and on ;-) % % ~Todd Geders HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
msg02105/pgp00000.pgp
Description: PGP signature
_______________________________________________ Bug-fileutils mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-fileutils