Re: [systemd-devel] Problem expanding environment variables

2024-09-06 Thread Thomas Köller
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.

Re: [systemd-devel] Problem expanding environment variables

2024-09-06 Thread Andrei Borzenkov
On Fri, Sep 6, 2024 at 1:40 PM Thomas Köller 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

Re: [systemd-devel] Problem expanding environment variables

2024-09-06 Thread Silvio Knizek
Am Freitag, dem 06.09.2024 um 10:18 +0200 schrieb Thomas Köller: > I am having problems expanding environment variables in a service file. > This test serivice illustrates the problem: > > `root@yoga:/etc/systemd/system# cat varexp.service` > > ```ini > [Unit] > Description = Test environment

Re: [systemd-devel] Problem expanding environment variables

2024-09-06 Thread Andrei Borzenkov
On Fri, Sep 6, 2024 at 11:24 AM Thomas Köller wrote: > > I am having problems expanding environment variables in a service file. > This test serivice illustrates the problem: > > root@yoga:/etc/systemd/system# cat varexp.service > [Unit] > Description = Test environment variable expansion > > [Ser

[systemd-devel] Problem expanding environment variables

2024-09-06 Thread Thomas Köller
I am having problems expanding environment variables in a service file. This test serivice illustrates the problem: root@yoga:/etc/systemd/system# cat varexp.service [Unit] Description = Test environment variable expansion [Service] Type = oneshot Environment = "VAR=abc-xyz" ExecStart = sh -c '