[BETA] Test grep regex changes to setup-ngxblocker

This commit is contained in:
Mitchell Krog 2019-07-05 13:09:23 +02:00
parent 41c057b0fc
commit 10433fbf85
No known key found for this signature in database
GPG key ID: C243C388553EDE5D

View file

@ -221,9 +221,8 @@ find_line() {
# ignore file #comments # ignore file #comments
#first) awk "/$find_str/{ print NR; exit }" $file;; #first) awk "/$find_str/{ print NR; exit }" $file;;
#last) awk "/$find_str/{ print NR }" $file | tail -n1;; #last) awk "/$find_str/{ print NR }" $file | tail -n1;;
first) grep -nE "^[[:space:]]+find_str" $file | head -n1 | awk -F: '{print $1}';;
first) grep -nE "^$[[:space:]]+find_str" $file | head -n1 | awk -F: '{print $1}';; last) grep -nE "[[:space:]]+$find_str" $file | tail -n1 | awk -F: '{print $1}';;
last) grep -nE "^[[:space:]]+$find_str" $file | tail -n1 | awk -F: '{print $1}';;
esac esac
} }