From 40decbd7692d9c08ed25ad3e39b16af084c8be44 Mon Sep 17 00:00:00 2001 From: Schark Date: Tue, 5 Dec 2023 21:47:49 -0800 Subject: Init scripts --- process-rss | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 process-rss (limited to 'process-rss') 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 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" + + + -- cgit v1.2.3-18-g5258