summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-28 18:36:00 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-01 13:40:52 +0100
commit4d729e3796e2c48e6840b86a1474d8009d8d940d (patch)
tree0df758e09de250195641cb2b559caac303042c7a
parent36f57e02d768d006c7b610e1f99cda87e115f6a8 (diff)
downloadsystemd-4d729e3796e2c48e6840b86a1474d8009d8d940d.tar.gz
man: move quoting description to systemd.syntax
We use very similar quoting rules in many places. Let's move this lengthy text out of systemd.service page.
-rw-r--r--man/systemd.service.xml98
-rw-r--r--man/systemd.syntax.xml90
2 files changed, 96 insertions, 92 deletions
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
index 0e9fa3e732..501da54b8a 100644
--- a/man/systemd.service.xml
+++ b/man/systemd.service.xml
@@ -1107,11 +1107,9 @@
</variablelist>
<para>Check
- <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
- and
- <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry>
- for more settings.</para>
-
+ <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> and
+ <citerefentry><refentrytitle>systemd.kill</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more
+ settings.</para>
</refsect1>
<refsect1>
@@ -1126,21 +1124,13 @@
<varname>ExecStop=</varname>, and
<varname>ExecStopPost=</varname> options.</para>
- <para>Multiple command lines may be concatenated in a single
- directive by separating them with semicolons (these semicolons
- must be passed as separate words). Lone semicolons may be escaped
- as <literal>\;</literal>.</para>
-
- <para>Each command line is split on whitespace, with the first item being the command to
- execute, and the subsequent items being the arguments. Double quotes ("…") and single quotes
- ('…') may be used to wrap a whole item (the opening quote may appear only at the beginning or
- after whitespace that is not quoted, and the closing quote must be followed by whitespace or the
- end of line), in which case everything until the next matching quote becomes part of the same
- argument. Quotes themselves are removed. C-style escapes are also supported. The table below
- contains the list of known escape patterns. Only escape patterns which match the syntax in the
- table are allowed; other patterns may be added in the future and unknown patterns will result in
- a warning. In particular, any backslashes should be doubled. Finally, a trailing backslash
- (<literal>\</literal>) may be used to merge lines.</para>
+ <para>Multiple command lines may be concatenated in a single directive by separating them with semicolons
+ (these semicolons must be passed as separate words). Lone semicolons may be escaped as
+ <literal>\;</literal>.</para>
+
+ <para>Each command line is unquoted using the rules described in "Quoting" section in
+ <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>5</manvolnum></citerefentry>. The
+ first item becomes the command to execute, and the subsequent items the arguments.</para>
<para>This syntax is inspired by shell syntax, but only the meta-characters and expansions
described in the following paragraphs are understood, and the expansion of variables is
@@ -1240,74 +1230,6 @@ ls</programlisting>
<literal>&gt;/dev/null</literal>,
<literal>&amp;</literal>, <literal>;</literal>, and
<literal>ls</literal>.</para>
-
- <table>
- <title>C escapes supported in command lines and environment variables</title>
- <tgroup cols='2'>
- <colspec colname='escape' />
- <colspec colname='meaning' />
- <thead>
- <row>
- <entry>Literal</entry>
- <entry>Actual value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry><literal>\a</literal></entry>
- <entry>bell</entry>
- </row>
- <row>
- <entry><literal>\b</literal></entry>
- <entry>backspace</entry>
- </row>
- <row>
- <entry><literal>\f</literal></entry>
- <entry>form feed</entry>
- </row>
- <row>
- <entry><literal>\n</literal></entry>
- <entry>newline</entry>
- </row>
- <row>
- <entry><literal>\r</literal></entry>
- <entry>carriage return</entry>
- </row>
- <row>
- <entry><literal>\t</literal></entry>
- <entry>tab</entry>
- </row>
- <row>
- <entry><literal>\v</literal></entry>
- <entry>vertical tab</entry>
- </row>
- <row>
- <entry><literal>\\</literal></entry>
- <entry>backslash</entry>
- </row>
- <row>
- <entry><literal>\"</literal></entry>
- <entry>double quotation mark</entry>
- </row>
- <row>
- <entry><literal>\'</literal></entry>
- <entry>single quotation mark</entry>
- </row>
- <row>
- <entry><literal>\s</literal></entry>
- <entry>space</entry>
- </row>
- <row>
- <entry><literal>\x<replaceable>xx</replaceable></literal></entry>
- <entry>character number <replaceable>xx</replaceable> in hexadecimal encoding</entry>
- </row>
- <row>
- <entry><literal>\<replaceable>nnn</replaceable></literal></entry>
- <entry>character number <replaceable>nnn</replaceable> in octal encoding</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
</refsect1>
<refsect1>
diff --git a/man/systemd.syntax.xml b/man/systemd.syntax.xml
index 7960adb659..5f207912b9 100644
--- a/man/systemd.syntax.xml
+++ b/man/systemd.syntax.xml
@@ -74,10 +74,10 @@
<filename>.ini</filename> files.
</para>
- <para>Each file is a plain text file divided into sections, with configuration entries in the
- style <replaceable>key</replaceable>=<replaceable>value</replaceable>.
- Whitespace immediately before or after the <literal>=</literal> is ignored. Empty lines and lines starting with <literal>#</literal> or <literal>;</literal> are
- ignored, which may be used for commenting.</para>
+ <para>Each file is a plain text file divided into sections, with configuration entries in the style
+ <replaceable>key</replaceable>=<replaceable>value</replaceable>. Whitespace immediately before or after
+ the <literal>=</literal> is ignored. Empty lines and lines starting with <literal>#</literal> or
+ <literal>;</literal> are ignored, which may be used for commenting.</para>
<para>Lines ending in a backslash are concatenated with the following line while reading and the
backslash is replaced by a space character. This may be used to wrap long lines. The limit on
@@ -130,6 +130,88 @@ KeyThree=value 3\
</refsect1>
<refsect1>
+ <title>Quoting</title>
+
+ <para>For settings where quoting is allowed, the following general rules apply: double quotes ("…") and
+ single quotes ('…') may be used to wrap a whole item (the opening quote may appear only at the beginning
+ or after whitespace that is not quoted, and the closing quote must be followed by whitespace or the end
+ of line), in which case everything until the next matching quote becomes part of the same item. Quotes
+ themselves are removed. C-style escapes are also supported. The table below contains the list of known
+ escape patterns. Only escape patterns which match the syntax in the table are allowed; other patterns may
+ be added in the future and unknown patterns will result in a warning. In particular, any backslashes
+ should be doubled. Finally, a trailing backslash (<literal>\</literal>) may be used to merge lines, as
+ described above.</para>
+
+ <table>
+ <title>Supported C escapes</title>
+ <tgroup cols='2'>
+ <colspec colname='escape' />
+ <colspec colname='meaning' />
+ <thead>
+ <row>
+ <entry>Literal</entry>
+ <entry>Actual value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>\a</literal></entry>
+ <entry>bell</entry>
+ </row>
+ <row>
+ <entry><literal>\b</literal></entry>
+ <entry>backspace</entry>
+ </row>
+ <row>
+ <entry><literal>\f</literal></entry>
+ <entry>form feed</entry>
+ </row>
+ <row>
+ <entry><literal>\n</literal></entry>
+ <entry>newline</entry>
+ </row>
+ <row>
+ <entry><literal>\r</literal></entry>
+ <entry>carriage return</entry>
+ </row>
+ <row>
+ <entry><literal>\t</literal></entry>
+ <entry>tab</entry>
+ </row>
+ <row>
+ <entry><literal>\v</literal></entry>
+ <entry>vertical tab</entry>
+ </row>
+ <row>
+ <entry><literal>\\</literal></entry>
+ <entry>backslash</entry>
+ </row>
+ <row>
+ <entry><literal>\"</literal></entry>
+ <entry>double quotation mark</entry>
+ </row>
+ <row>
+ <entry><literal>\'</literal></entry>
+ <entry>single quotation mark</entry>
+ </row>
+ <row>
+ <entry><literal>\s</literal></entry>
+ <entry>space</entry>
+ </row>
+ <row>
+ <entry><literal>\x<replaceable>xx</replaceable></literal></entry>
+ <entry>character number <replaceable>xx</replaceable> in hexadecimal encoding</entry>
+ </row>
+ <row>
+ <entry><literal>\<replaceable>nnn</replaceable></literal></entry>
+ <entry>character number <replaceable>nnn</replaceable> in octal encoding</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </refsect1>
+
+ <refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>