diff options
Diffstat (limited to 'process-rss')
-rwxr-xr-x | process-rss | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/process-rss b/process-rss new file mode 100755 index 0000000..4044fe9 --- /dev/null +++ b/process-rss @@ -0,0 +1,27 @@ +#!/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 <description> tags using sed +sed -i '/^<description>/,/<\/description>/ s/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g' "$FILE" + +echo "Processing complete. Original file backed up as $FILE.bak" + + + |