From 35c982cb501b207cd93b3c0c69f4cf2196b5da2d Mon Sep 17 00:00:00 2001 From: Mitchell Krog Date: Thu, 4 Jul 2019 09:36:27 +0200 Subject: [PATCH] REVERT grep first) last) fails all test but awk passes all tests --- .dev-tools/setup-ngxblocker/setup-ngxblocker | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.dev-tools/setup-ngxblocker/setup-ngxblocker b/.dev-tools/setup-ngxblocker/setup-ngxblocker index b9a0d61af..f57f46384 100644 --- a/.dev-tools/setup-ngxblocker/setup-ngxblocker +++ b/.dev-tools/setup-ngxblocker/setup-ngxblocker @@ -219,10 +219,8 @@ find_line() { case "$first_last" in # ignore file #comments - #first) awk "/$find_str/{ print NR; exit }" $file;; - #last) awk "/$find_str/{ print NR }" $file | tail -n1;; - first) grep -nE "^[ ]+$find_str" $file | head -n1 | awk -F: '{print $1}';; - last) grep -nE "^[ ]+$find_str" $file | tail -n1 | awk -F: '{print $1}';; + first) awk "/$find_str/{ print NR; exit }" $file;; + last) awk "/$find_str/{ print NR }" $file | tail -n1;; esac }