mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 18:19:55 +00:00
REVERT grep first) last) fails all test but awk passes all tests
This commit is contained in:
parent
48df7fa77c
commit
35c982cb50
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue