help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Word splitting


From: Stephane Chazelas
Subject: Re: [Help-bash] Word splitting
Date: Thu, 3 Oct 2019 13:50:09 +0100
User-agent: NeoMutt/20171215

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]