> one last note on this because it is kind of interesting.
...
> I think that in limited situations, inconsistency is a good thing.
> And, conversely, one can take consistency as an absolute good, and run
> off the road.
...
> ron
I agree with most of this, and with most of what I've edited out.
But I think that in this case we can distinguish two types of
utilities: those that behave inconsistently for a well thought out
and useful reason, and those which are inconsistent merely because
someone wasn't thinking properly.
Cat, for example, is inconsistent for sensible reasons. In a world
where it has options, and p9 cat still doesn't, the convention of
assuming stdin in the absence of arguments is mildly useful. It's
also easy to add /dev/null to the list if you want to avoid that
behaviour. Globbing can be a problem here, which is what the OP was
complaining about, but that is, if anything, a problem with the shell.
Rm is, I think, an example of someone who simply wasn't thinking
properly. In
rm `{ complicated pipeline }
I almost certainly want the exit status to reflect whether all the
selected files were deleted, even if there weren't any, so I want
rm without arguments to succeed silently. There is no real advantage
to the present behaviour. Yes, it warns you that you might not have
removed what you wanted to, but that's not the way UNIX and it's
descendants are supposed to behave. After all, if I type
rm -rf $jnukdir/*
then I don't expect a warning that $jnukdir is not defined while
$junkdir is, and that perhaps what I really meant was
rm -rf $junkdir
Everything can be carried to extreme. Even ancestor worship. The
basic utilities were written by smart people who didn't always fully
understand what they were doing. There is nothing radical about
suggesting that we try not to repeat their mistakes.
--
John Stalker
School of Mathematics
Trinity College Dublin
tel +353 1 896 1983
fax +353 1 896 2282