I have to change a properties file containing the property: ro.product.firmware=0.0.1 with a new value that is coming from a function called in a different section of my bash script. I cannot get the regex to work properly. For this particular case I need the value to be changed from 0.0.1 to $1 but the value will not always be 0.0.1. The regex I currently have  is:sed -i 's/^(ro\.product\.firmware).*$/(ro\.product\.firmware=$1)'
sed replace after matching character
shell;shell script;sed
This should work for your case: sed -ri 's/^(ro\.product\.firmware\=)(.*)$/\1'$1'/g' file.txtHere, -r ==> for using extended regex\1 ==> for the first captured group