Reputation: 9653
sed -i '' -e 's/firstdomain.com/seconddomain.com/g'
Should I escape the dot? if so how can I do that?
Upvotes: 0
Views: 55
Reputation: 247062
Dot is a regex metacharacter meaning "match any character", so yes you do need to escape it:
sed -i '' -e 's/firstdomain\.com/seconddomain.com/g'
Within a bracket expression, dot loses its special meaning, so you could do this:
sed -i '' -e 's/firstdomain[.]com/seconddomain.com/g'
If you don't escape it, the string "firstdomain-com" (among others) would match
Upvotes: 1