3 ms·
Ah, I misread your first post as meaning '...\'...' instead of literally '\''. I've always used the '"'"' method, or "$(sed -r 's/([allthespecialchars])/\
by Tiksi 12y ago
Ah, I misread your first post as meaning '...\'...' instead of literally '\''. I've always used the '"'"' method, or
"$(sed -r 's/([allthespecialchars])/\\\1/g')"
, but '\'' is much cleaner.
I have found the terminate and escape quite useful for color codes though
'string'\e[31m'red'"$var"'morestring',
not sure how I never thought to use it for '\'', but thats getting added to my toolbox :)