#!/bin/bash # Check if a file was provided if [ "$#" -ne 1 ]; then echo "Usage: $0 [file]" exit 1 fi # File to be processed FILE="$1" # Check if the file exists if [ ! -f "$FILE" ]; then echo "Error: File not found." exit 1 fi # Create a backup of the original file cp "$FILE" "$FILE.bak" # Replace special characters within tags using sed sed -i '/^/,/<\/description>/ s/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g' "$FILE" echo "Processing complete. Original file backed up as $FILE.bak"