Lee Huan Chul <[EMAIL PROTECTED]> 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



_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to