summaryrefslogtreecommitdiff
path: root/process-rss
diff options
context:
space:
mode:
authorSchark <jordan@schark.online>2023-12-05 21:47:49 -0800
committerSchark <jordan@schark.online>2023-12-05 21:47:49 -0800
commit40decbd7692d9c08ed25ad3e39b16af084c8be44 (patch)
tree5989985e974d41d7d81c51ce7e78e76858ab1a93 /process-rss
downloadscripts-40decbd7692d9c08ed25ad3e39b16af084c8be44.tar.gz
scripts-40decbd7692d9c08ed25ad3e39b16af084c8be44.zip
Init scripts
Diffstat (limited to 'process-rss')
-rwxr-xr-xprocess-rss27
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/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&apos;/g' "$FILE"
+
+echo "Processing complete. Original file backed up as $FILE.bak"
+
+
+