Это сработает:
sed -i -e "s@<span class=\"symbol\"></span>@[\]{custom-style=\"symbol\"}@g" myfile.md
Вам нужно использовать \
перед &
, тогда это будет работать нормально, потому что &
является специальным в тексте замены :это означает «вся часть ввода, которая была сопоставлена с шаблоном».
Изman sed
:
s/regexp/replacement/
The replacement may contain the special character & to refer to that portion of the pattern space which matched, and the special escapes \1 through \9 to refer to the corresponding matching sub-expressions in the regexp.