It turns out just plain dash works fine. $ echo systemctl status dev-disk-by\x2dpath-pci\x2d0000:00:1f.1\x2data\x2d1.device|sed s/x2/-/g|sh -x + systemctl status dev-disk-by-dpath-pci-d0000:00:1f.1-data-d1.device ● dev-disk-by-dpath-pci-d0000:00:1f.1-data-d1.device Loaded: loaded Active: inactive (dead)