Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Use == in expressions instead of the deprecated =
- X-seq: zsh-workers 39228
- From: Teubel György <tgyurci@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Use == in expressions instead of the deprecated =
- Date: Mon, 5 Sep 2016 23:27:54 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=JE7/xzTTIdXH04KUlyNhBPbQbsCJIIjHCZm/FI4UKkg=; b=fyssrJCbl4EDV26UNeO6gm/HBMZjE18/6Q2nS4V7nJn9fYjsVE1yI+k5pc+aMCiHjA vlM7yddkczezC0RksaPy8pqt4UOrvg9QC+p1SpKMVOk9LTJY4WXs6M5IZ5gsaTnSm9vJ Onqst9r72dBOQz5PR5kGBmuFLMymUi7/EtJE4kReHXWlfx6njkVi9GoO8RJLSKe+CA4T E5e9vb2GEQZ+7R7LmYfzgATmVo5EucyWqHa7fm7SVFBxl+UMaNn35syke3XFtrjBHJ86 W8mRY13qA/dxpUKGUuy6dxT3pQWTE5efghZTgcmL1rulQGh9W4DrGoKlYOvqdIaDknJM s3pA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
Doc/Zsh/compsys.yo | 2 +-
Doc/Zsh/cond.yo | 2 +-
Doc/Zsh/contrib.yo | 2 +-
Doc/Zsh/expn.yo | 18 +++++++++---------
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index 8c7ef0f..060a5c5 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -2532,7 +2532,7 @@ current prefix is empty, is a single `tt(.)', or consists only of a path
beginning with `tt(../)'. Otherwise the value is `false'.
example(zstyle -e ':completion:*' special-dirs \
- '[[ $PREFIX = LPAR()../RPAR()#LPAR()|.|..RPAR() ]] && reply=LPAR()..RPAR()')
+ '[[ $PREFIX == LPAR()../RPAR()#LPAR()|.|..RPAR() ]] && reply=LPAR()..RPAR()')
)
kindex(squeeze-slashes, completion style)
item(tt(squeeze-slashes))(
diff --git a/Doc/Zsh/cond.yo b/Doc/Zsh/cond.yo
index 3d369fb..e87c1e6 100644
--- a/Doc/Zsh/cond.yo
+++ b/Doc/Zsh/cond.yo
@@ -248,7 +248,7 @@ tt($LPAR()LPAR())var(...)tt(RPAR()RPAR()).
For example, the following:
-example([[ ( -f foo || -f bar ) && $report = y* ]] && print File exists.)
+example([[ ( -f foo || -f bar ) && $report == y* ]] && print File exists.)
tests if either file tt(foo) or file tt(bar) exists, and if so, if the
value of the parameter tt(report) begins with `tt(y)'; if the complete
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 63df292..cf3a398 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -540,7 +540,7 @@ at run time:
example(zstyle -e ':chpwd:*' recent-dirs-file pick-recent-dirs-file
pick-recent-dirs-file+LPAR()RPAR() {
- if [[ $PWD = ~/text/writing+LPAR()|/*RPAR() ]]; then
+ if [[ $PWD == ~/text/writing+LPAR()|/*RPAR() ]]; then
reply=(~/.chpwd-recent-dirs-writing)
else
reply=(+)
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index ecb1877..40932fe 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -967,12 +967,12 @@ for this purpose since quotes are not stripped from non-pattern
characters by tt(GLOB_SUBST). In other words,
example(pattern=${(q)str}
-[[ $str = ${~pattern} ]])
+[[ $str == ${~pattern} ]])
works if tt($str) is `tt(a*b)' but not if it is `tt(a b)', whereas
example(pattern=${(b)str}
-[[ $str = ${~pattern} ]])
+[[ $str == ${~pattern} ]])
is always true for any possible value of tt($str).
)
@@ -1228,7 +1228,7 @@ that follow tt(~) within the same set of parentheses. Compare with tt(~)
outside parentheses, which forces the entire substituted string to
be treated as a pattern. Hence, for example,
-example([[ "?" = ${(~j.|.)array} ]])
+example([[ "?" == ${(~j.|.)array} ]])
treats `tt(|)' as a pattern and succeeds if and only if tt($array)
contains the string `tt(?)' as an element. The tt(~) may be
@@ -1829,20 +1829,20 @@ example(zsh_directory_name+LPAR()RPAR() {
emulate -L zsh
setopt extendedglob
local -a match mbegin mend
- if [[ $1 = d ]]; then
+ if [[ $1 == d ]]; then
# turn the directory into a name
- if [[ $2 = (#b)(/home/pws/perforce/)([^/]##)* ]]; then
+ if [[ $2 == (#b)(/home/pws/perforce/)([^/]##)* ]]; then
typeset -ga reply
reply=(p:$match[2] $(( ${#match[1]} + ${#match[2]} )) )
else
return 1
fi
- elif [[ $1 = n ]]; then
+ elif [[ $1 == n ]]; then
# turn the name into a directory
[[ $2 != (#b)p:(?*) ]] && return 1
typeset -ga reply
reply=(/home/pws/perforce/$match[1])
- elif [[ $1 = c ]]; then
+ elif [[ $1 == c ]]; then
# complete names
local expl
local -a dirs
@@ -2206,7 +2206,7 @@ parentheses can be referenced.
For example,
example(foo="a string with a message"
-if [[ $foo = (a|an)' '(#b)(*)' '* ]]; then
+if [[ $foo == (a|an)' '(#b)(*)' '* ]]; then
print ${foo[$mbegin[1],$mend[1]]}
fi)
@@ -2224,7 +2224,7 @@ The numbering of backreferences strictly follows the order of the opening
parentheses from left to right in the pattern string, although sets of
parentheses may be nested. There are special rules for parentheses followed
by `tt(#)' or `tt(##)'. Only the last match of the parenthesis is
-remembered: for example, in `tt([[ abab = (#b)([ab])# ]])', only the final
+remembered: for example, in `tt([[ abab == (#b)([ab])# ]])', only the final
`tt(b)' is stored in tt(match[1]). Thus extra parentheses may be necessary
to match the complete segment: for example, use
`tt(X+LPAR()(ab|cd)#+RPAR()Y)' to match
--
2.9.3
Messages sorted by:
Reverse Date,
Date,
Thread,
Author