wok diff pm-utils/stuff/grep-x.patch @ rev 16158
Add fasm
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Mar 28 21:31:11 2014 +0000 (2014-03-28) |
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 Fri Mar 28 21:31:11 2014 +0000 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 + }