From c24e5cd3f629717b63efbab85c4244a6701661e8 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Tue, 12 Dec 2017 12:45:25 +0000 Subject: [PATCH] :codacy: :codacy2: :codacy3: Signed-off-by: Adam Warner --- gravity.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gravity.sh b/gravity.sh index 072804ea..62cf36b9 100755 --- a/gravity.sh +++ b/gravity.sh @@ -281,8 +281,8 @@ gravity_ParseFileIntoDomains() { #Awk -F splits on given IFS, we grab the right hand side (chops trailing #coments and /'s to grab the domain only. #Last awk command takes non-commented lines and if they have 2 fields, take the left field (the domain) and leave #+ the right (IP address), otherwise grab the single field. - cat ${source} | \ - awk -F '#' '{print $1}' | \ + + < ${source} awk -F '#' '{print $1}' | \ awk -F '/' '{print $1}' | \ awk '($1 !~ /^#/) { if (NF>1) {print $2} else {print $1}}' | \ sed -nr -e 's/\.{2,}/./g' -e '/\./p' > ${destination}