]> git.ipfire.org Git - thirdparty/systemd.git/commit
run: expand variables also with --scope 27113/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 4 Apr 2023 19:18:33 +0000 (21:18 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 24 Apr 2023 08:02:30 +0000 (10:02 +0200)
commit2ed7a221fafb25eea937c4e86fb88ee501dba51e
tree559f741a0058cb6e61c8322c62a020a59570c24a
parentde99fadd3117d2bbe3d5fdf1c6e7b6855fccf465
run: expand variables also with --scope

This makes syntax be the same for commands which are started by the manager and
those which are spawned directly (when --scope is used).

Before:
$ systemd-run -q -t echo '$TERM'
xterm-256color

$ systemd-run -q --scope echo '$TERM'
$TERM

Now:
$ systemd-run -q --scope echo '$TERM'
xterm-256color

Previous behaviour can be restored via --expand-environment=no:
$ systemd-run -q --scope --expand-environment=no echo '$TERM'
$TERM

Fixes #22948.

At some level, this is a compat break. Fortunately --scope is not very widely
used, so I think we can get away with this. Having different syntax depending
on whether --scope was used or not was bad UX.

A NEWS entry will be required.
man/systemd-run.xml
src/run/run.c