wok-6.x diff pm-utils/stuff/grep-x.patch @ rev 21468
updated monitorix (3.2.1 -> 3.11.0)
author | Hans-G?nter Theisgen |
---|---|
date | Tue Apr 30 15:42:25 2019 +0100 (2019-04-30) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/pm-utils/stuff/grep-x.patch Tue Apr 30 15:42:25 2019 +0100 1.3 @@ -0,0 +1,27 @@ 1.4 +--- functions.in.orig 1.5 ++++ functions.in.new 1.6 +@@ -215,8 +215,22 @@ 1.7 + for p in "$@"; do 1.8 + echo "$p" >> "$PARAMETERS.rm" 1.9 + done 1.10 +- # let grep do the dirty work. 1.11 +- grep -vxFf "$PARAMETERS.rm" "$PARAMETERS" > "$PARAMETERS.new" 1.12 ++ # let awk do the dirty work. 1.13 ++ cat "$PARAMETERS" | awk -v VAR="$(cat "$PARAMETERS.rm")" ' 1.14 ++ { 1.15 ++ del=0 1.16 ++ split(VAR,rm) 1.17 ++ for(i in rm) 1.18 ++ { 1.19 ++ if($1==rm[i]){ 1.20 ++ del++ 1.21 ++ } 1.22 ++ } 1.23 ++ if(del==0) 1.24 ++ { 1.25 ++ print $1 1.26 ++ } 1.27 ++ }' > "$PARAMETERS.new" 1.28 + fi 1.29 + cp -f "$PARAMETERS.new" "$PARAMETERS" 1.30 + }