Lee Huan Chul <address@hidden> writes:
[...]
> make file of which name is "-file" and do "ls *file"
> then error occures like this
>
> ls: invalid option -- e
> Try `ls --help' for more information.
>
> this is because coreutils uses raw argv(in main) as getopt's argument(in
> decode_switches, ls.c:1371).
This happens because all arguments that start with a '-' are parsed as
an option. In this can -file means the same as -f -i -l -e. The ls
command does not know the argument '-e'.
If you make the file -fil instead of -file you can see better what
happens.
To prevent ls from parsing the argument a options you can use "--" as
you can read in the documentation. For example:
ls -- *file
--
Marco