Summary: | app-shells/bash-4.1_p7 bad double-quoted pattern substitution with arrays | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Diego Augusto Molina <diegoaugustomolina> |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED INVALID | ||
Severity: | minor | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
URL: | http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00294.html | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Diego Augusto Molina
2011-02-25 12:00:28 UTC
Possible workaround: $ q="'" $ echo "${my_array[@]/#/$q}" 'a 'b 'c 'd 'e (In reply to comment #1) > Possible workaround: > > $ q="'" > $ echo "${my_array[@]/#/$q}" > 'a 'b 'c 'd 'e > Thanks a lot Ulrich, I didn't thought about that. It really simplifies the code. I have sent a bug report to the developers. Chet Ramey answered my e-mail (reporting the bug) and here's what he said: >Maybe. However, bash has always treated embedded quoted strings as >introducing a new `quoting context', even within double quotes. This >has occasionally resulted in awkward constructs, of which this is >one. > >FWIW, of the shells with arrays I had handy to test, ksh93 and mksh do >the same thing. zsh behaves as you prefer. I assume this behaviour is intentional. Thus, closing the bug as invalid. |