2 .TH "SYSTEMD\-ESCAPE" "1" "" "systemd 218" "systemd-escape"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
17 .\" disable justification (adjust text to left margin only)
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
23 systemd-escape \- Escape strings for usage in system unit names
25 .HP \w'\fBsystemd\-escape\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB[STRING...]\fR\ 'u
26 \fBsystemd\-escape \fR\fB[OPTIONS...]\fR\fB \fR\fB[STRING...]\fR
30 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\&.
32 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\&.
34 By default this command will escape the strings passed, unless
36 is passed which results in the inverse operation being applied\&. If
38 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\&.
41 The following options are understood:
45 Appends the specified unit type suffix to the escaped string\&. Takes one of the unit types supported by systemd, such as
48 "\&.mount"\&. May not be used in conjunction with
57 Inserts the escaped strings in a unit name template\&. Takes a unit name template such as
59 May not be used in conjunction with
66 \fB\-\-path\fR, \fB\-p\fR
68 When escaping or unescaping a string, assume it refers to a file system path\&. This enables special processing of the initial
75 Instead of escaping the specified strings, undo the escaping, reversing the operation\&. May not be used in conjunction with
85 \fB\-\-escape\fR, 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
92 \fB\-h\fR, \fB\-\-help\fR
94 Print a short help text and exit\&.
99 Print a short version string and exit\&.
103 Escape a single string:
109 $ systemd\-escape \*(AqHallöchen, Meister\*(Aq
110 Hall\exc3\exb6chen\ex2c\ex20Meister
116 To undo escaping on a single string:
122 $ systemd\-escape \-u \*(AqHall\exc3\exb6chen\ex2c\ex20Meister\*(Aq
129 To generate the mount unit for a path:
135 $ systemd\-escape \-p \-\-suffix=mount "/tmp//waldi/foobar/"
136 tmp\-waldi\-foobar\&.mount
142 To generate instance names of three strings
148 $ systemd\-escape \-\-template=systemd\-nspawn@\&.service \*(AqMy Container 1\*(Aq \*(Aqcontainerb\*(Aq \*(Aqcontainer/III\*(Aq
149 systemd\-nspawn@My\ex20Container\ex201\&.service systemd\-nspawn@containerb\&.service systemd\-nspawn@container\-III\&.service
156 On success, 0 is returned, a non\-zero failure code otherwise\&.