One of the ways replacing a string with sed can be done as follows:
sed -i 's/old_str/new_str/' file.txt
However if replace.sh is
sed -i 's/$1/$2/' $3
the command ./replace.sh old_str new_str file.txt doesn't seem to work -- after making replace.sh executable of course. Why is that?
I am aware rpl does exactly the same as I intend to do with replace.sh, but I'd like to understand why is it not working.