[systemd-devel] variable expansion in ExecStart

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Sat Oct 4 17:53:00 PDT 2014


On Sun, Oct 05, 2014 at 02:30:42AM +0300, Uoti Urpala wrote:
> 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?
Yeah, I guess that this is useful. The fact that nobody complained about current
behaviour suggests that either people are happy with it or that it simply doesn't
matter. Needs to be documented though.

Zbyszek


More information about the systemd-devel mailing list