systemd-escape_command_examples

systemd-escape_command_examples

systemd-escape – Escape strings for usage in system unit names

Escape a single string:

$ systemd-escape 'Hallöchen, Meister'

Hall\xc3\xb6chen\x2c\x20Meister

To undo escaping on a single string:

$ systemd-escape -u 'Hall\xc3\xb6chen\x2c\x20Meister'

Hallöchen, Meister

To generate the mount unit for a path:

$ systemd-escape -p --suffix=mount "/tmp//waldi/foobar/"
tmp-waldi-foobar.mount

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

Leave a Reply

Your email address will not be published. Required fields are marked *