From: Christian Neukirchen <chneukirchen@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] Use == in expressions instead of the deprecated =
Date: Fri, 09 Sep 2016 19:01:27 +0200 [thread overview]
Message-ID: <87twdpaty0.fsf@juno.home.vuxu.org> (raw)
In-Reply-To: <20160908143128.GA14933@chaz.gmail.com> (Stephane Chazelas's message of "Thu, 8 Sep 2016 15:31:28 +0100")
Stephane Chazelas <stephane.chazelas@gmail.com> writes:
> 2016-09-08 12:16:28 +0100, Peter Stephenson:
> [...]
>> diff --git a/Doc/Zsh/cond.yo b/Doc/Zsh/cond.yo
>> index 3d369fb..6fcf3bd 100644
>> --- a/Doc/Zsh/cond.yo
>> +++ b/Doc/Zsh/cond.yo
>> @@ -103,8 +103,8 @@ true if var(file1) and var(file2) exist and
>> refer to the same file.
>> xitem(var(string) tt(=) var(pattern))
>> item(var(string) tt(==) var(pattern))(
>> true if var(string) matches var(pattern).
>> -The `tt(==)' form is the preferred one. The `tt(=)' form is for
>> -backward compatibility and should be considered obsolete.
>> +The `tt(==)' form is the preferred one for clarity in new shell code
>> +as it more closely resembles other languages.
> [...]
>
> ksh93 also makes "==" obsolete in [[...]].
My ksh93 (ksh-2012.08.01) man page says:
Conditional Expressions.
A conditional expression is used with the [[ compound command to test
attributes of files and to compare strings.
...
string == pattern
True, if string matches pattern. Any part of pattern can be
quoted to cause it to be matched as a string. With a successful
match to a pattern, the .sh.match array variable will contain
the match and sub-pattern matches.
string = pattern
Same as == above, but is obsolete.
--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org
next prev parent reply other threads:[~2016-09-09 17:01 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-05 21:27 Teubel György
2016-09-08 8:35 ` Peter Stephenson
2016-09-08 11:16 ` Peter Stephenson
2016-09-08 14:31 ` Stephane Chazelas
2016-09-08 15:06 ` Stephane Chazelas
2016-09-08 15:14 ` Peter Stephenson
2016-09-08 16:39 ` Mikael Magnusson
2016-09-08 18:47 ` Stephane Chazelas
2016-09-09 12:03 ` Vincent Lefevre
[not found] ` <CGME20160912143133eucas1p11a4e6916dd70b3ceaa163bf3bddfb007@eucas1p1.samsung.com>
2016-09-12 14:31 ` Peter Stephenson
2016-09-09 8:52 ` Stephane Chazelas
2016-09-09 9:31 ` Peter Stephenson
2016-09-09 16:00 ` Stephane Chazelas
2016-09-14 22:01 ` PATCH: [[ -v varname ]] Oliver Kiddle
2016-09-15 10:55 ` Vincent Lefevre
2016-09-16 0:36 ` Bart Schaefer
2016-09-15 11:08 ` Stephane Chazelas
2016-09-15 11:22 ` wrong "export -p" output for exported but not set variables (Was: PATCH: [[ -v varname ]]) Stephane Chazelas
2016-09-09 17:01 ` Christian Neukirchen [this message]
2016-09-09 18:54 ` [PATCH] Use == in expressions instead of the deprecated = Stephane Chazelas
2016-09-09 13:05 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87twdpaty0.fsf@juno.home.vuxu.org \
--to=chneukirchen@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).