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: <20091003183127.GC15021@nipl.net> References: <20091003160327.GA15021@nipl.net> <7359f0490910031001s3354e29awfb916f953bb96ec@mail.gmail.com> <20091003183127.GC15021@nipl.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13431.1254758938.1@kryten> Date: Mon, 5 Oct 2009 17:08:58 +0100 Message-ID: <200910051708.aa33544@salmon.maths.tcd.ie> Subject: Re: [9fans] mishandling empty lists - let's fix it Topicbox-Message-UUID: 7ef076c8-ead5-11e9-9d60-3106f5b1d025 > Does anyone agree with me that it needs fixing? For what it's worth, I agree that it's a problem. Maybe it's just the fact that I'm a mathematician, but I've always felt that any command which accepts a list of files should behave the way I would expect when presented with an empty list. Cat, rm, chmod, etc. do not. At a minimum I think we should try to avoid creating further exceptions. Does it need fixing? Implementing it properly would break most shell scripts I've written. If there were renamed versions of cat, rm, chmod, etc. which treated empty lists in the expected way then I would probably use them in situations were portability is not an issue. It would remove a frequent source of bugs and leave me with one less thing to worry about. Then there is the shell. If you only use commands which behave sanely for empty lists then the current globbing rules are a pain. Changing them to, for example, expand * to `' in an empty directory breaks too many things. I've learned to avoid globbing as much as possible. In any shell with command substitution globbing is unnecessary, and is often dangerous. I would happily use a shell with NO globbing, just to avoid another source of worries. -- John Stalker School of Mathematics Trinity College Dublin tel +353 1 896 1983 fax +353 1 896 2282