Friday, July 03, 2020

find and replace http with https with sed

htm pages under the SI folder used to give a POST request to http://www.radiosai.org/program/PlayNow.php
which we needed to change to https, since otherwise the POST requests do not get redirected

PB did this with
SI# ls
2011  2012  2013  2014  2015  2016  (etc)

SI# find ./ -type f -exec sed -i 's/action=\"http/action=\"https/g' {} \;

More examples of sed with find are given at https://linuxize.com/post/how-to-use-sed-to-find-and-replace-string-in-files/

No comments:

Post a Comment