Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [[ is being treated as a pattern in the command/reserved word position.
- X-seq: zsh-workers 34796
- From: ZyX <kp-pav@xxxxxxxxx>
- To: Eric Cook <llua@xxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: [[ is being treated as a pattern in the command/reserved word position.
- Date: Sun, 29 Mar 2015 00:36:48 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1427578609; bh=oAAeI6v92+24/wZD5XMt1udQK/w9DcRLxYM5d2ucSs8=; h=From:To:In-Reply-To:References:Subject:Date; b=a9IsixHrz3t489vmoQwZHiKlPuczY3nsXSC1mtp1I9CYd81qTu9Zuh1t3tolzpSTw jYHZlnFk/YEmnyc4zwxDrh0sQPpwraIixMU4lI28bXaVUWLnoDDFhWHO6Icn+Xdb2S MFt1Vw8bW8+RSzYFfBabvmfO1AQjjxr8p+VuoZr4=
- In-reply-to: <55171842.7030505@gmx.com>
- 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
- References: <55171842.7030505@gmx.com>
29.03.2015, 00:14, "Eric Cook" <llua@xxxxxxx>:
> With a recent build, this happens to me. Does it happen for anyone else?
>
> % type [[
> zsh: bad pattern: [[
This is expected: you open a collection, but do not close it.
> % type '[['
> [[ is a reserved word
> % '[[' a == a ]]
> zsh: = not found
`[[` is *not* a command. Neither it is a shell builtin. It is an extension to the shell syntax. So this is expected as well. You see exactly this error message because `=tty` expands to `/usr/bin/tty`.
> % '[[' a '==' a ]]
> zsh: command not found: [[
Same, but you got rid of `==` error.
> % print $ZSH_PATCHLEVEL
> zsh-5.0.7-0-g208bded
`[[` is a *syntax extension* which works *only* if `[[` (literally) occurs in command position. In first commented case you violate “in command position condition”, in other commented cases you violate “literally”.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author