[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: x[
From: |
Stephane Chazelas |
Subject: |
Re: x[ |
Date: |
Mon, 29 Jul 2019 18:53:38 +0100 |
User-agent: |
NeoMutt/20171215 |
2019-07-29 17:55:58 +0100, Isabella Bosia:
> haven't really looked into why this happens but x[ seems to trigger some
> funny parser behavior
>
> x[ newline should not prompt with PS2
>
> it can't be defined as a normal sh function, but it can be defined with the
> function keyword
[...]
x[ is the start of an array element assignment. newline is valid (just a token
separator like space) inside an arithmetic expression.
$ x[
> 1
> +
> 1
> ]=3
$ typeset -p x
declare -a x=([2]="3")
You'll notice:
$ +[
+[: command not found
$ 'x'[
x[: command not found
--
Stephane
- x[, Isabella Bosia, 2019/07/29
- Re: x[, Clint Hepner, 2019/07/29
- Re: x[, Eli Schwartz, 2019/07/29
- Re: x[, Greg Wooledge, 2019/07/29
- Re: x[, Martijn Dekker, 2019/07/29
- Re: x[, Eli Schwartz, 2019/07/29
- Re: x[, Koichi Murase, 2019/07/29
Message not available
- Re: x[,
Stephane Chazelas <=
Re: x[, Chet Ramey, 2019/07/29