Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: More POSIX developments
- X-seq: zsh-workers 20442
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: More POSIX developments
- Date: Mon, 04 Oct 2004 11:23:57 +0100
- In-reply-to: <Pine.LNX.4.61.0410021419240.25270@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <Pine.LNX.4.61.0409241908380.1714@xxxxxxxxxxxxxxxxxx> <200409271104.i8RB4URU009112@xxxxxxxxxxxxxx> <Pine.LNX.4.61.0410021419240.25270@xxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
> Finally got a chance to look at this.
>
> On Mon, 27 Sep 2004, Peter Stephenson wrote:
>
> > The following patch, which I won't commit until we've decided which way
> > to go, tries to cover the bases by making test work (more) like POSIX
> > while leaving [[ ... ]] the way it is. The errors now return status 2
> > from evalcond, but for backward compatibility [[ ... ]] turns them into
> > shell errors.
>
> I think this would be OK.
Yes, the more I think about it the less likely it is that someone using
"test" or "[" syntax wants anything other than standard-compliant
behaviour.
> > In other words, could I remove zwarnnamopt and make zwarnnam behave like
> > that?
>
> I think that'd be safe, but I wouldn't object to a second opinion.
I made the change and none of the tests failed. I think it's neater to
do it like this and see if any problems turn up.
Before I commit the patch, here's some proposed documentation.
Index: Doc/Zsh/builtins.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/builtins.yo,v
retrieving revision 1.70
diff -u -r1.70 builtins.yo
--- Doc/Zsh/builtins.yo 30 Jun 2004 11:10:45 -0000 1.70
+++ Doc/Zsh/builtins.yo 4 Oct 2004 10:21:15 -0000
@@ -1124,6 +1124,11 @@
item(tt([) [ var(arg) ... ] tt(]))(
Like the system version of tt(test). Added for compatibility;
use conditional expressions instead (see noderef(Conditional Expressions)).
+The main differences are: this command is not handled syntactically, so for
+example an empty variable expansion may cause an argument to be omitted;
+syntax errors cause status 2 to be returned instead of a shell error; and
+arithmetic operators expect integer arguments rather than arithemetic
+expressions.
)
findex(times)
cindex(shell, timing)
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author