Suppose my file a.conf is as following
Include /1
Include /2
Include /3
I want to replace "Include /2" with a new line, I write the code in .sh file :
line="Include \\/2"
rep=""
sed "s/${line}/${rep}/g" /root/new_scripts/a.conf
> /tmp/a.conf-new
mv /tmp/a.conf-new /root/new_scripts/a.conf
0 comments:
Post a Comment