From 14eccc4c6d936d3a25f82d0dbdd8681875b8849d Mon Sep 17 00:00:00 2001 From: columndeeply Date: Sun, 25 Dec 2022 11:17:52 +0100 Subject: [PATCH] Fix ^M showing up in some lists --- scripts/cleanup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh index ffccc4c..dca782f 100755 --- a/scripts/cleanup.sh +++ b/scripts/cleanup.sh @@ -20,8 +20,8 @@ for file in "$@"; do ## Remove any lines pointing to an IP address, hosts file only works with domains or hostnames sed -i -r '/ ([0-9]{1,3}\.){3}[0-9]{1,3}$/d' "$file" - # Remove multiple spaces (If anybody knows how to do this with sed please let me know) - tr -s ' ' < "$file" > "$file.tmp" + # Remove multiple spaces and return lines (If anybody knows how to do this with sed please let me know) + tr -s ' ' < "$file" | tr -d '\r' > "$file.tmp" # Remove any domain that exists in the whitelist grep -v -x -f ../whitelist "$file.tmp" > "$file.tmp2"