[systemd-devel] Problem expanding environment variables

Andrei Borzenkov arvidjaar at gmail.com
Fri Sep 6 10:43:46 UTC 2024


On Fri, Sep 6, 2024 at 1:40 PM Thomas Köller <thomas at koeller.dyndns.org> wrote:
>
> Am 06.09.24 um 11:04 schrieb Andrei Borzenkov:
> > You need to quote $ to pass it to the shell.
> > ExecStart = sh -c 'echo Res: $${VAR#abc-}'
>
> Yes, this works. However, I didn't find this anywhere in the systemd man
> pages. What I found was escaping using a backslash, but that didn't work.
>
>

"man systemd.service", section "Command lines", scroll down.

To pass a literal dollar sign, use "$$".


More information about the systemd-devel mailing list