DisplayManager._0.setup: /usr/lib64/X11/xdm/Xsetup_0
и
! DisplayManager._0.setup: /usr/lib64/X11/xdm/Xsetup_0
пробовал:
#!/usr/bin/env bash
function zzz() {
local r="DisplayManager\.\_0\.setup\:\ \ \ \ \/usr\/lib64\/X11\/xdm\/Xsetup\_0" # old
local u="\!\ \DisplayManager\.\_0\.setup\:\ \/usr\/lib64\/X11\/xdm\/Xsetup\_0" # new
local f="/etc/X11/xdm/xdm-config" # config file
if [[ -f ${f} ]]; then
sed -i -e "s/${r}/${u}/g" "${f}"
echo "zzz1"
fi
}
zzz
printf '%q' "DisplayManager._0.setup: /usr/lib64/X11/xdm/Xsetup_0" #тоже некорректно выводит строку