From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5af6e2ed0383fbe611b91c4569eff7b6@hamnavoe.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] termrc changes From: Richard Miller <9fans@hamnavoe.com> Date: Tue, 28 Nov 2006 20:11:35 +0000 In-Reply-To: <85ddf2f6f3d679b9fc463f5dda358380@plan9.bell-labs.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: e7d9fa3c-ead1-11e9-9d60-3106f5b1d025 > If test were modified to process > all its arguments at the start (presumably building an expression > tree), it could then complain about excess arguments again. I have a modified version of test which uses a parameter for e(), e1(), etc to determine whether sub-expressions should be evaluated or just parsed. This allows the whole test command to be checked for syntax, while preserving the lazy semantics ("short circuit") of -a and -o. I haven't submitted it because it seems somehow clunky. A much simpler change would be just to have -a and -o behave like & and | instead of like && and ||; in other words, to perform both tests (and therefore syntax check the whole command) before combining the boolean results. I've looked at the posix description of test and it doesn't actually say that -a and -o have to be lazy. Would this cause any problems in practice? -- Richard