[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Behaviour of test -v with assoc array and quote character in key
From: |
Alex fxmbsw7 Ratchev |
Subject: |
Re: Behaviour of test -v with assoc array and quote character in key |
Date: |
Tue, 23 Feb 2021 12:59:19 +0100 |
yeah i thought so.. thanks
On Tue, Feb 23, 2021 at 12:52 PM Léa Gris <lea.gris@noiraude.net> wrote:
> Le 23/02/2021 à 12:17, Alex fxmbsw7 Ratchev écrivait :
> > what, sorry, mailing stuff isnt much clear to me, ... its not possible to
> > have a var=\'\] ; assoc[$var] ?
>
> You can if assoc is declared an associative array before:
>
> > $ (LANG=C; unset var assoc; var=\'\]; assoc[$var]=hello; typeset -p
> assoc)
> > bash: ']: syntax error: operand expected (error token is "']")
>
> but:
>
> > $ (LANG=C; unset var assoc; var=\'\]; declare -A assoc;
> assoc[$var]=hello; typeset -p assoc)
> > declare -A assoc=(["']"]="hello" )
>
>
>
>
> --
> Léa Gris
>
>
>
- Behaviour of test -v with assoc array and quote character in key, Daniel Gröber, 2021/02/14
- Re: Behaviour of test -v with assoc array and quote character in key, Greg Wooledge, 2021/02/15
- Re: Behaviour of test -v with assoc array and quote character in key, Chet Ramey, 2021/02/15
- Re: Behaviour of test -v with assoc array and quote character in key, Andreas Schwab, 2021/02/23
- Re: Behaviour of test -v with assoc array and quote character in key, Greg Wooledge, 2021/02/23
- Re: Behaviour of test -v with assoc array and quote character in key, Oğuz, 2021/02/23
- Re: Behaviour of test -v with assoc array and quote character in key, Greg Wooledge, 2021/02/23
- Re: Behaviour of test -v with assoc array and quote character in key, Oğuz, 2021/02/23
- Re: Behaviour of test -v with assoc array and quote character in key, Chet Ramey, 2021/02/23