I have a script with the follow code:
find . -name "*.html" -print0 | while IFS= read -r -d '' n; do
sed -i -r 's/<font color="#bbbbbb">\.<\/font>.*?<input[^µ]*?mabulle\.hide\(\)">//1' "$n"
sed -i -r 's/<\/body>/<a href="\.\/00Tree\.html">Back<\/a><\/body>/' "$n" #add back link
done
The second sed
is not working. If I run
sed -i -r 's/<\/body>/<a href="\.\/00Tree\.html">Back<\/a><\/body>/' filename.html
from the command line it works perfectly.
The html files are named 0_name.html, 1_name.html, etc.
What am I doing wrong?
sed
works after processing the first one from command line? Can you give a tiny html sample to understand better the meaning of working?