sed replace variable in double quotes

Reference

https://stackoverflow.com/questions/31707923/sed-replace-variable-in-double-quotes

Before:

variable=$1
echo $variable
sed -i -e 's/name="master"/name="$variable"/g' test

Variable expansion does not happen within single quotes. Do it in double quotes:

sed -i -e 's/name="master"/name="'"$variable"'"/g' test