Just like new line want keep indentation as before.
replaced=" def"
sed -i "/ abc/c $replaced" temp.txt
in this case , the new line will lost the space , no indentation
The way to do it :
replaced="\ def"
sed -i "/ abc/c $replaced" temp.txt
This will keep space after the replacement.