]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: move quoting description to systemd.syntax
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 28 Feb 2021 17:36:00 +0000 (18:36 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 1 Mar 2021 12:40:52 +0000 (13:40 +0100)
We use very similar quoting rules in many places. Let's move this
lengthy text out of systemd.service page.

man/systemd.service.xml
man/systemd.syntax.xml

index 0e9fa3e7323f2c1d63143c9256c3a12c71a49af5..501da54b8aa54e36fc9ba5c1f39272c69bd74662 100644 (file)
     </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>
     <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>
index 7960adb65977eb421631e5f7400d1cf4fea67fc8..5f207912b952be977fcaab71fc51414530cfecf6 100644 (file)
     <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
@@ -129,6 +129,88 @@ KeyThree=value 3\
     file format.</para>
   </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>