find or replace through sed
I am successfully execute the below command in my script :
sed '/findstring/s//replacestring/g' find1.txt > /root/Desktop/output1.txt
but when I want to replace it with some runtime input it fails .
I want to accept a string from user and then find, replace it.
Below is my script :
#Script for Find and Replace
#sed '/$findstring/s//$replacestring/g' find1.txt > /root/Desktop/output1.txt
# Below line executed successfully.
#sed '/tea/s//milk/g' find1.txt > /root/Desktop/output1.txt
#sed -i 's/findstring/replacestring/g' *
echo "Script executed successfully"
Pls help how could I achieve this.
Thanks & Regards