From 6129ab89bd2229888e3d2d0709784f71225596a9 Mon Sep 17 00:00:00 2001 From: curben <2809763-curben@users.noreply.gitlab.com> Date: Wed, 13 May 2020 11:37:40 +0100 Subject: [PATCH] refactor: replace echo with printf --- script.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script.sh b/script.sh index b7c70225..0891e516 100644 --- a/script.sh +++ b/script.sh @@ -117,9 +117,9 @@ sed "1s/Malicious/Online Malicious/" > "../urlhaus-filter-online.txt" ## Domains-only blocklist -# awk + head is a workaround for sed '1 i\'"$COMMENT"'' -COMMENT=$(echo -E "$COMMENT_ABP" | tr "!" "#" | sed "1s/URL/Domains/" | awk '{printf "%s\\n", $0}' | head -c -2) -COMMENT_ONLINE=$(echo -E "$COMMENT" | sed "1s/Malicious/Online Malicious/" | awk '{printf "%s\\n", $0}' | head -c -2) +# awk + head is a workaround for sed prepend +COMMENT=$(printf "$COMMENT_ABP" | sed "s/^!/#/g" | sed "1s/URL/Domains/" | awk '{printf "%s\\n", $0}' | head -c -2) +COMMENT_ONLINE=$(printf "$COMMENT" | sed "1s/Malicious/Online Malicious/" | awk '{printf "%s\\n", $0}' | head -c -2) cat "malware-domains.txt" | \ sort | \