From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Stalker To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: <13426df10910061127m7331b58dqba8abf01a0fc11f8@mail.gmail.com> References: <544954.87352.qm@web83908.mail.sp1.yahoo.com> <200910061900.ab25356@salmon.maths.tcd.ie> <13426df10910061127m7331b58dqba8abf01a0fc11f8@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <581.1254904251.1@kryten> Date: Wed, 7 Oct 2009 09:30:51 +0100 Message-ID: <200910070930.aa64725@salmon.maths.tcd.ie> Subject: Re: [9fans] mishandling empty lists - let's fix it Topicbox-Message-UUID: 82dfce0a-ead5-11e9-9d60-3106f5b1d025 > 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