mirror of
https://git.proxmox.com/git/systemd
synced 2025-06-05 03:13:52 +00:00
63 lines
7.0 KiB
HTML
63 lines
7.0 KiB
HTML
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-escape</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
|
|
a.headerlink {
|
|
color: #c60f0f;
|
|
font-size: 0.8em;
|
|
padding: 0 4px 0 4px;
|
|
text-decoration: none;
|
|
visibility: hidden;
|
|
}
|
|
|
|
a.headerlink:hover {
|
|
background-color: #c60f0f;
|
|
color: white;
|
|
}
|
|
|
|
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
|
|
visibility: visible;
|
|
}
|
|
</style><a href="index.html">Index </a>·
|
|
<a href="systemd.directives.html">Directives </a>·
|
|
<a href="../python-systemd/index.html">Python </a>·
|
|
<a href="../libudev/index.html">libudev </a>·
|
|
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</span><hr><div class="refentry"><a name="systemd-escape"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-escape — Escape strings for usage in system unit names</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">systemd-escape</code> [OPTIONS...] [STRING...]</p></div></div><div class="refsect1"><a name="idm140373133324816"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p><span class="command"><strong>systemd-escape</strong></span> may be used to escape
|
|
strings for inclusion in systemd unit names. The command may be
|
|
used to escape and to undo escaping of strings.</p><p>The command takes any number of strings on the command line,
|
|
and will process them individually, one after the other. It will
|
|
output them separated by spaces to stdout.</p><p>By default this command will escape the strings passed,
|
|
unless <code class="option">--unescape</code> is passed which results in the
|
|
inverse operation being applied. If <code class="option">--mangle</code> a
|
|
special mode of escaping is applied instead, which assumes a
|
|
string to be already escaped but will escape everything that
|
|
appears obviously non-escaped.</p></div><div class="refsect1"><a name="idm140373133320944"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options">¶</a></h2><p>The following options are understood:</p><div class="variablelist"><dl class="variablelist"><dt id="--suffix="><span class="term"><code class="option">--suffix=</code></span><a class="headerlink" title="Permalink to this term" href="#--suffix=">¶</a></dt><dd><p>Appends the specified unit type suffix to the
|
|
escaped string. Takes one of the unit types supported by
|
|
systemd, such as "<code class="literal">.service</code>" or
|
|
"<code class="literal">.mount</code>". May not be used in conjunction with
|
|
<code class="option">--template=</code>, <code class="option">--unescape</code> or
|
|
<code class="option">--mangle</code>.</p></dd><dt id="--template="><span class="term"><code class="option">--template=</code></span><a class="headerlink" title="Permalink to this term" href="#--template=">¶</a></dt><dd><p>Inserts the escaped strings in a unit name
|
|
template. Takes a unit name template such as
|
|
<code class="filename">foobar@.service</code> May not be used in
|
|
conjunction with <code class="option">--suffix=</code>,
|
|
<code class="option">--unescape</code> or
|
|
<code class="option">--mangle</code>.</p></dd><dt id="--path"><span class="term"><code class="option">--path</code>, </span><span class="term"><code class="option">-p</code></span><a class="headerlink" title="Permalink to this term" href="#--path">¶</a></dt><dd><p>When escaping or unescaping a string, assume
|
|
it refers to a file system path. This enables special
|
|
processing of the initial "<code class="literal">/</code>" of the
|
|
path.</p></dd><dt id="--unescape"><span class="term"><code class="option">--unescape</code></span><a class="headerlink" title="Permalink to this term" href="#--unescape">¶</a></dt><dd><p>Instead of escaping the specified strings,
|
|
undo the escaping, reversing the operation. May not be used in
|
|
conjunction with <code class="option">--suffix=</code>,
|
|
<code class="option">--template=</code> or
|
|
<code class="option">--mangle</code>.</p></dd><dt id="--mangle"><span class="term"><code class="option">--mangle</code></span><a class="headerlink" title="Permalink to this term" href="#--mangle">¶</a></dt><dd><p>Like <code class="option">--escape</code>, but only
|
|
escape characters that are obviously not escaped yet, and
|
|
possibly automatically append an appropriate unit type suffix
|
|
to the string. May not be used in conjunction with
|
|
<code class="option">--suffix=</code>, <code class="option">--template=</code> or
|
|
<code class="option">--unescape</code>.</p></dd><dt id="-h"><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#-h">¶</a></dt><dd><p><a name="help-text"></a>Print a short help text and exit.
|
|
</p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version">¶</a></dt><dd><p><a name="version-text"></a>Print a short version string and exit.</p></dd></dl></div></div><div class="refsect1"><a name="idm140373137252160"></a><h2 id="Examples">Examples<a class="headerlink" title="Permalink to this headline" href="#Examples">¶</a></h2><p>Escape a single string:</p><pre class="programlisting">$ systemd-escape 'Hallöchen, Meister'
|
|
Hall\xc3\xb6chen\x2c\x20Meister</pre><p>To undo escaping on a single string:</p><pre class="programlisting">$ systemd-escape -u 'Hall\xc3\xb6chen\x2c\x20Meister'
|
|
Hallöchen, Meister</pre><p>To generate the mount unit for a path:</p><pre class="programlisting">$ systemd-escape -p --suffix=mount "/tmp//waldi/foobar/"
|
|
tmp-waldi-foobar.mount</pre><p>To generate instance names of three strings</p><pre class="programlisting">$ systemd-escape --template=systemd-nspawn@.service 'My Container 1' 'containerb' 'container/III'
|
|
systemd-nspawn@My\x20Container\x201.service systemd-nspawn@containerb.service systemd-nspawn@container-III.service</pre></div><div class="refsect1"><a name="idm140373137239232"></a><h2 id="Exit status">Exit status<a class="headerlink" title="Permalink to this headline" href="#Exit%20status">¶</a></h2><p>On success, 0 is returned, a non-zero failure code
|
|
otherwise.</p></div><div class="refsect1"><a name="idm140373137238080"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
|
|
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
|
|
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>
|
|
</p></div></div></body></html>
|