[systemd-devel] variable expansion in ExecStart

Uoti Urpala uoti.urpala at pp1.inet.fi
Sat Oct 4 16:30:42 PDT 2014


On Sat, 2014-10-04 at 21:24 +0200, Zbigniew Jędrzejewski-Szmek wrote:
> Environment="X='Y' Z"
> ExecStart=/bin/echo $X ${X}
> 
> results in echo[31266]: Y Z 'Y' Z
> 
> i.e., $X not only splits at whitespace, as documented, but also strips quotes.
> Is this by design, or is it an implementation accident? Should this behaviour
> be changed?

Isn't the current behavior with quotes the only way to pass an arbitrary
number of arguments that possibly contain whitespace? If you want $FOO
to expand to the argument list ["a", "b c"] you can currently express
that as "a 'b c'". If you remove unquoting, there is no alternative
syntax, is there?




More information about the systemd-devel mailing list