I have a .txt file which has sed replace commands on each line and has 1000+ entries. The file is on my server.
Can any one please help me how to run the commands in file line by line and execute till the end of file.
My txt file looks like
sed -i 's|http://www.myoldsite/url/category/another/blah|http://www.mynewsite.com|g' ./db.sql
sed -i 's|http://www.myoldsite/url/category/blah/blah|http://www.mynewsite.com|g' ./db.sql
sed -i 's|http://www.myoldsite/url/category/blah|http://www.mynewsite.com|g' ./db.sql
You can convert your file to a list of substitution commands by removing all occurrences of
sed -i ' and
Using process substitution, the list can then be processed as a file passed to the sed
sed -i -f <(sed "s/[^']*'//;s/'.*//" file) ./db.sql