On Wed, Jun 10, 2020 at 01:29:03PM +0100, Sid Boyce wrote:
Now I get it, it was because the one file started with
a "-", renamed it
without the "-" and all is OK. No doubt the first time I came across such a
Let me try to explain the full story.
The key information is that unlike in the old times of MS-DOS, the
wildcards are expanded by shell and this happens _before_ the argument
list is passed to the program.
Therefore if you have (only) e.g. a.txt, b.txt and c.txt in current
directory, there is no difference between
ls -l *.txt
ls -l a.txt b.txt c.txt
(if there is a matching name with spaces, you would have to escape it on
second line). Names starting with a dash behave the same so with "-a"
and "foo", there is no difference between
ls -l *
ls -l -a foo
and the command has no way to recognize that "-l" is an option actually
entered and "-a" is not.
To unsubscribe, e-mail: opensuse-factory+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-factory+owner(a)opensuse.org