On 2017-03-16 20:13, Brian K. White wrote:
On 3/16/2017 2:13 PM, Carlos E. R. wrote:
On 2017-03-16 18:04, David Haller wrote:
Hello,
*Gah* Don't you learn the absolute basics of the shell you use anymore?
Why in the world should rm act otherwise when you call it with the '-i' option? No matter if you typed the -i or if it is the result of globbing?
Well, no, I was not aware of this. And I have been using the Linux shell bash for almost two decades.
I thought, without thinking, that the command would differentiate between options and filenames automatically. No, it is not so, not in Linux. The shell expands the '*' and gets all options and filenames as just strings in the same command line. MsDos doesn't get this confusion, it is the app which has to do the expansion after it parses the command line.
Sorry, but shell expansion is basics. If you managed to go 20 years without knowing how the shell works, that doesn't mean it was secret hidden unfathomable knowledge. The fault is yours not the shells.
I know the parts of how the shell works that I have needed, and yes, I have read the manual more than once. And I wrote many scripts. I simply did not notice the implications of a file named "-c". You simply have to notice how many here did not know, considering how many will confess, afraid of you belittling them. maybe the documentation was not written well.
And the windows cmd command line parsing is absolutely terrible example. You may not understand or like the rules that all of the unix shells follow, but the at least have rules, which they follow, and which are consistent and predictable and allow you to express anything you need. The same is NOT true of cmd.exe. The quoting and command line parsing rules for that were drawn by kindergarteners in crayon.
Your opinion noted. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" (Minas Tirith))