I have a few directories, all of which have it's own index.html file inside. I want to scan these directories (I don't know how much of them will it be and how named) and replace one line in all of the index.html files they contain.
The line I look for is base href=". I want to put a given text at the end of this string. For example the text may be: /testing/demo. Then I want all the index.html files to contain base href="/testing/demo.
Also, two additional steps must be made - if there's a slash / at the end of the given string, it should delete it. If there's not a slash at the beginning, it should add it.
I tried to use sed comand somehow.
for d in $(find ${S3_URI} -type d); do find $d -iname "index.html" .............sedcommand to replace the strings.It doesn't exist yet- we're asking you to create and post an example. See How to Ask.