2019-10-03 13:48:08 +0200, Paul Wagner:
[...]
> Sometimes I would want bash to 'honor' quotes inside parameter expansions,
> i.e. treat quotes inside an expansion not as literal, but as syntactical, in
> order to prevent word splitting inside pairs of those quotes.
[...]
> My practical solution would be arrays, but that feels not very elegant, and
> I found a rather theoretical one (as it only works in my minimal example) to
> be
>
> $ eval "for p in xxx $s zzz; do echo \$p; done"
[...]
How is using an array (which has been designed for that) to
store a list of strings not elegant?
As a side question, if $s is:
s='foo ~ $(uname) "$(uname) $(whoami)" $PATH'
What elements would you like that to result to?
--
Stephane