X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=man%2Fsystemd-escape.xml;h=86ef175ab8308d4c5330a2d034f588624289aa47;hb=9d1345f0657c707df89b41b2738776efb40aec8e;hp=5407773f2369790017d73957d7e85e18bbe8d266;hpb=6c9e781ebadda6c92ef88c4c5348948076f16340;p=thirdparty%2Fsystemd.git diff --git a/man/systemd-escape.xml b/man/systemd-escape.xml index 5407773f236..86ef175ab83 100644 --- a/man/systemd-escape.xml +++ b/man/systemd-escape.xml @@ -1,25 +1,7 @@ - - - + @@ -27,15 +9,6 @@ systemd-escape systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - @@ -45,7 +18,7 @@ systemd-escape - Escape strings for usage in system unit names + Escape strings for usage in systemd unit names @@ -64,7 +37,7 @@ used to escape and to undo escaping of strings. The command takes any number of strings on the command line, - and will process them individually, one after the other. It will + and will process them individually, one after another. It will output them separated by spaces to stdout. By default, this command will escape the strings passed, @@ -73,6 +46,9 @@ special mode of escaping is applied instead, which assumes the string is already escaped but will escape everything that appears obviously non-escaped. + + For details on the escaping and unescaping algorithms see the relevant section in + systemd.unit5. @@ -86,8 +62,8 @@ Appends the specified unit type suffix to the escaped string. Takes one of the unit types supported by - systemd, such as .service or - .mount. May not be used in conjunction with + systemd, such as service or + mount. May not be used in conjunction with , or . @@ -97,9 +73,12 @@ Inserts the escaped strings in a unit name template. Takes a unit name template such as - foobar@.service May not be used in - conjunction with , - or + foobar@.service. With + , expects instantiated unit names + for this template and extracts and unescapes just the instance + part. May not be used in conjunction with + , + or . @@ -107,24 +86,27 @@ - When escaping or unescaping a string, assume - it refers to a file system path. This enables special - processing of the initial / of the - path. + When escaping or unescaping a string, assume it refers to a file system path. This eliminates + leading, trailing or duplicate / characters and rejects . and + .. path components. This is particularly useful for generating strings suitable for + unescaping with the %f specifier in unit files, see + systemd.unit5. + + Instead of escaping the specified strings, undo the escaping, reversing the operation. May not be used in - conjunction with , - or + conjunction with or . + Like , but only escape characters that are obviously not escaped yet, and @@ -134,6 +116,19 @@ . + + + + With , unescape + and print only the instance part of an instantiated unit name + template. Results in an error for an uninstantiated template + like ssh@.service or a non-template name + like ssh.service. + Must be used in conjunction with + and may not be used in conjunction with + . + + @@ -143,7 +138,7 @@ Examples - Escape a single string: + To escape a single string: $ systemd-escape 'Hallöchen, Meister' Hall\xc3\xb6chen\x2c\x20Meister @@ -155,9 +150,17 @@ Hallöchen, Meister $ systemd-escape -p --suffix=mount "/tmp//waldi/foobar/" tmp-waldi-foobar.mount - To generate instance names of three strings + To generate instance names of three strings: $ 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 + + To extract the instance part of an instantiated unit: + $ systemd-escape -u --instance 'systemd-nspawn@My\x20Container\x201.service' +My Container 1 + + To extract the instance part of an instance of a particular template: + $ systemd-escape -u --template=systemd-nspawn@.service 'systemd-nspawn@My\x20Container\x201.service' +My Container 1 @@ -171,6 +174,7 @@ systemd-nspawn@My\x20Container\x201.service systemd-nspawn@containerb.service sy See Also systemd1, + systemd.unit5, systemctl1