I am trying to use the stream editor sed in bash to replace a string in a file to a new string that I entered, I have this thus far:
echo "name to change"
read updatenaamold
echo "enter new name:"
read updatenaamnew
sed -i 's/$updatenaamold/$updatenaamnew/g' $naam_dir
echo "name changed"
This should work! But it doesn't somehow, in the file that I want to edit there is a name called "bryan" I want to edit it to "bryan name". I've put the old name in a variable that i need to enter obviously, and the new name in a variable aswell. Can someone point out to me why it doesn't work?