fix-html.sh 556 B

12345678910111213
  1. #!/bin/bash -e
  2. find . -type f -name "*.html" | while read -r file; do
  3. # Remove <script> tags and their content independently, across multiple lines, and case-insensitively
  4. perl -0777 -pi -e 's/<script\b[^>]*?>.*?<\/script>//gsi' "$file"
  5. # Replace all instances of 'http://sophira.i8.com/' with '/'
  6. perl -pi -e 's|http://sophira\.i8\.com/|/|g' "$file"
  7. # Remove all content between the banner comments, inclusive
  8. perl -0777 -pi -e 's/<!-- Auto Banner Insertion Begin -->.*?<!-- Auto Banner Insertion Complete THANK YOU -->//gsi' "$file"
  9. done