I would like to replace string in file contains ${user.home} using sed in Linux but I'm unable to do it. I tried below options using sed but failed.
<property name="dev.home" value="${user.home}"/>
${user.home}
:sed -i "s/$${user.home}/r_str/g" 1.xml
sed -i "s/${user.home}/r_str/g" 1.xml
sed -i "s/\$\{user\.home\}/r_str/g" 1.xml
<property name="dev.home" value="${user.home}"/>
<property name="dev.home" value="/dev"/>
You don't need to escape the curly braces {}
echo '${user.home}' | sed "s/\${user.home}/lol$/"
lol$