A Unix annoyance
January 26, 2006
I dearly love Unix, but I am forced to admit that every so often it
has what I can only describe as 'robot logic'; things that are
perfectly logical, but not to normal humans. For example, consider the
fun of trying to remove a file called something like "
$ rm -Brad Foo rm: invalid option -- B $ rm "-Brad Foo" rm: invalid option -- B $ rm ./-Brad Foo rm: cannot remove `./-Brad': No such file or directory rm: cannot remove `Foo': No such file or directory
(and so on.)
Of course this is happening because the arguments are processed twice;
once by the shell to determine what's a single argument and what gets
split up, and then again by
I've used Unix sufficiently long and deeply that that I can see and explain all of this in my sleep. It all makes perfect sense and it's completely consistent and logical (once you understand Unix's logic).
But let's be honest here: it's robot logic, not human logic.
(This entry is inspired by the travails of a perfectly technically
adept Unix person in a similar situation, as recounted
here. He had a
simpler example that didn't need being escaped from the shell, just
* * *
Atom feeds are available; see the bottom of most pages.