summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-04-04 21:18:33 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-04-24 10:02:30 +0200
commit2ed7a221fafb25eea937c4e86fb88ee501dba51e (patch)
tree559f741a0058cb6e61c8322c62a020a59570c24a /man
parentde99fadd3117d2bbe3d5fdf1c6e7b6855fccf465 (diff)
downloadsystemd-2ed7a221fafb25eea937c4e86fb88ee501dba51e.tar.gz
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.
Diffstat (limited to 'man')
-rw-r--r--man/systemd-run.xml11
1 files changed, 6 insertions, 5 deletions
diff --git a/man/systemd-run.xml b/man/systemd-run.xml
index f33190f4c5..73adbfb927 100644
--- a/man/systemd-run.xml
+++ b/man/systemd-run.xml
@@ -177,11 +177,12 @@
<varlistentry>
<term><option>--expand-environment=<replaceable>BOOL</replaceable></option></term>
- <listitem><para>Expand environment variables in command arguments. If enabled (the default), the
- service manager that spawns the actual command will expand variables specified as
- <literal>${<replaceable>VARIABLE</replaceable>}</literal> in the same way as in commands specied via
- <varname>ExecStart=</varname> in units. Note that this is similar to, but not the same as variable
- expansion in
+ <listitem><para>Expand environment variables in command arguments. If enabled (the default),
+ environment variables specified as <literal>${<replaceable>VARIABLE</replaceable>}</literal> will be
+ expanded in the same way as in commands specified via <varname>ExecStart=</varname> in units. With
+ <varname>--scope</varname>, this expansion is performed by <command>systemd-run</command> itself, and
+ in other cases by the service manager that spawns the command. Note that this is similar to, but not
+ the same as variable expansion in
<citerefentry project='man-pages'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>
and other shells.</para>