From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: "zsh-users@zsh.org" <zsh-users@zsh.org>
Subject: Re: Bug / error in manpage.
Date: Tue, 2 Oct 2012 21:00:18 +0100 [thread overview]
Message-ID: <20121002210018.0a4e4c39@pws-pc.ntlworld.com> (raw)
In-Reply-To: <CC9082BE.9606%larrys@fb.com>
On Tue, 2 Oct 2012 18:39:31 +0000
Larry Schrof <larrys@fb.com> wrote:
> Agreed - I was thinking it was probably a matter of time before one of you
> came
> up with a good example.
>
> Are you thinking mentioning angle-brackets needing special quoting, or are
> you thinking about just removing mention of them from that section of
> the manpage?
I was going to mention the problem...
Index: Doc/Zsh/params.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/params.yo,v
retrieving revision 1.71
diff -p -u -r1.71 params.yo
--- Doc/Zsh/params.yo 21 Sep 2012 12:45:27 -0000 1.71
+++ Doc/Zsh/params.yo 2 Oct 2012 19:59:27 -0000
@@ -182,7 +182,10 @@ to the matching closing one is considere
The flags tt(s), tt(n) and tt(b) take an argument; the delimiter
is shown below as `tt(:)', but any character, or the matching pairs
`tt(LPAR())...tt(RPAR())', `tt({)...tt(})', `tt([)...tt(])', or
-`tt(<)...tt(>)', may be used.
+`tt(<)...tt(>)', may be used, but note that `tt(<)...tt(>)' can only be
+used if the subscript is inside a double quoted expression or a
+parameter substitution enclosed in braces as otherwise the expression is
+interpreted as a redirection.
The flags currently understood are:
Index: Src/lex.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/lex.c,v
retrieving revision 1.71
diff -p -u -r1.71 lex.c
--- Src/lex.c 2 Oct 2012 12:46:46 -0000 1.71
+++ Src/lex.c 2 Oct 2012 19:59:27 -0000
@@ -1218,7 +1218,7 @@ gettokstr(int c, int sub)
c = Comma;
break;
case LX2_OUTANG:
- if (in_brace_param || sub || brct)
+ if (in_brace_param || sub)
break;
e = hgetc();
if (e != '(') {
@@ -1255,7 +1255,7 @@ gettokstr(int c, int sub)
break;
}
lexstop = 0;
- if (in_brace_param || sub || brct)
+ if (in_brace_param || sub)
break;
goto brk;
case LX2_EQUALS:
Index: Test/A04redirect.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/A04redirect.ztst,v
retrieving revision 1.23
diff -p -u -r1.23 A04redirect.ztst
--- Test/A04redirect.ztst 8 Dec 2011 15:55:11 -0000 1.23
+++ Test/A04redirect.ztst 2 Oct 2012 19:59:27 -0000
@@ -441,3 +441,6 @@
0:failed assignment on non-posix-special, POSIX_BUILTINS
>output
?zsh: read-only variable: foo
+
+ [</dev/null ]
+1:check behaviour with square brackets
Index: Test/D06subscript.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/D06subscript.ztst,v
retrieving revision 1.14
diff -p -u -r1.14 D06subscript.ztst
--- Test/D06subscript.ztst 2 Oct 2012 12:46:46 -0000 1.14
+++ Test/D06subscript.ztst 2 Oct 2012 19:59:27 -0000
@@ -249,23 +249,3 @@
string[0]=!
1:Can't set only element zero of string
?(eval):1: string: assignment to invalid subscript range
-
- string="Life,+like+a+dome+of+many-colour'd+glass"
- for delims in "()" "{}" "[]" "<>"; do
- eval 'print ${string[(ws'$delims[1]'+'$delims[2]')2]}'
- eval 'print $string[(ws'$delims[1]'+'$delims[2]')3]'
- eval 'print "$string[(ws'$delims[1]'+'$delims[2]')4]"'
- done
-0:Check matched delimiters in subscripts
->like
->a
->dome
->like
->a
->dome
->like
->a
->dome
->like
->a
->dome
--
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
prev parent reply other threads:[~2012-10-02 20:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-01 18:08 Larry Schrof
2012-10-02 11:57 ` Peter Stephenson
2012-10-02 14:06 ` Bart Schaefer
2012-10-02 17:40 ` Larry Schrof
2012-10-02 18:35 ` Peter Stephenson
2012-10-02 18:39 ` Larry Schrof
2012-10-02 20:00 ` Peter Stephenson [this message]
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=20121002210018.0a4e4c39@pws-pc.ntlworld.com \
--to=p.w.stephenson@ntlworld.com \
--cc=zsh-users@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).