So simple,
im, thanks. Full path.
Buit still I wonder, why names got by glob are still seen as options. That may be risky.
It is risky. It is a bad thing. But since it has been standardized and gone over for about 30 or 40 years, it is considered correct behavior. Matter-of-fact, in the early 90s someone published a book called "The Unix haters handbook", and the example of having a file called "-Rf" in your directory and then doing "rm *" is chapter 1 of that book.
I consider it to be a nasty design flaw. In a well-designed system, this should not happen; there should be a clear distinction between options/flags/parameters and arguments to commands. Commands should be able to read what the command line was *before* globbing if they want to, and perform globbing only if appropriate, and how. But that's not the way Ritchie and Thompson wrote the first version, and their bad decision and shortcut has now become enshrined. Sad.
Other examples where this goes wrong: "find . -name foo*" fails if there are multiple files whose names start with foo in the current directory, while the intent of the find command is to find all files whose names start with foo. Or "echo Should we go to lunch ?" will spit out gibberish if the current directory contains files that have single-character file names, while "echo Should we go to lunch?" only does if the current directory contains files that are named "lunch" plus a single character. In the presence of unicode, all that goes completely insane, because the definition of "single character" becomes complex: what looks on the screen like a single character might not actually be one. And getting back: This command
Code:
echo "Should we go to lunch ?"
will work, independent of what files exist in the current directory. But that's not intuitive. Why do users need to learn how globbing and the shell work internally, and complicated quoting rules?
Well-designed operating systems (such as VMS or MVS/TSO) do not have these problems in their shells. But for Unix, this is water under the bridge.