[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Associative array keys are not reusable in (( command
From: |
Greg Wooledge |
Subject: |
Re: Associative array keys are not reusable in (( command |
Date: |
Mon, 11 Jan 2021 11:52:23 -0500 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
> > If you are reluctant to change semantics, how about a new parameter
> > transformation to quote values using `sh_single_quote'?
>
> Why, when @Q already exists?
It's often the case that the strings generated by bash are being
fed to some other shell, where $'...' doesn't work. Granted, you can
always do "'${myvar//$q/$q\\$q$q}'" (where q=\').
If the sh single quoting also helps you use associative array elements
inside a math context, then that would be a second reason. But at this
point I can't even *guess* whether it's safe to use sh-single-quoted
associative array keys inside a math context. I tried one with a
command substitution and a newline inside it, and it seemed to work, but
that doesn't mean it's *safe*.
- Re: Associative array keys are not reusable in (( command, (continued)
- Re: Associative array keys are not reusable in (( command, Oğuz, 2021/01/08
- Re: Associative array keys are not reusable in (( command, Chet Ramey, 2021/01/10
- Re: Associative array keys are not reusable in (( command, Oğuz, 2021/01/10
- Re: Associative array keys are not reusable in (( command, Chet Ramey, 2021/01/11
- Re: Associative array keys are not reusable in (( command, Greg Wooledge, 2021/01/11
- Re: Associative array keys are not reusable in (( command, Chet Ramey, 2021/01/11
- Re: Associative array keys are not reusable in (( command, Oğuz, 2021/01/11
- Re: Associative array keys are not reusable in (( command, Chet Ramey, 2021/01/11
- Re: Associative array keys are not reusable in (( command,
Greg Wooledge <=
- Re: Associative array keys are not reusable in (( command, Oğuz, 2021/01/11
- Re: Associative array keys are not reusable in (( command, Léa Gris, 2021/01/11
- Re: Associative array keys are not reusable in (( command, Léa Gris, 2021/01/11
- Re: Associative array keys are not reusable in (( command, Greg Wooledge, 2021/01/11
- Re: Associative array keys are not reusable in (( command, Oğuz, 2021/01/11