[systemd-devel] Argument quoting in Exec lines

Lennart Poettering lennart at poettering.net
Mon Sep 10 15:30:51 PDT 2012


On Tue, 04.09.12 09:12, Daniel Drake (dsd at laptop.org) wrote:

> Hi,
> 
> Not sure whether to submit a bug report or documentation patch for this.
> 
> ExecStart=/usr/bin/foo --arg1="foo bar"
> 
> Causes foo to be run with 2 command line args:
>  1. --arg1="foo
>  2. bar"
> 
> Not what I was hoping for.
> 
> Whereas:
> 
> ExecStart=/usr/bin/foo "--arg1=foo bar"
> 
> does what I want, just 1 command line arg:
>  1. --arg1=foo bar
> 
> 
> 
> Took me a while to figure that out. Is this the desired behaviour?

We are not a shell, this is desired behaviour. The word splitting code
is a bit naive currently, and could use some improvements in regards to
escaping but I actually think in this specific regard I like the current
behaviour.

I thought I had actually documented this somewhere but I must admit I
can find it right now. I have added a TODO list item for this now that
we add a proper explanation.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list