Files
libreoffice/bin/find-unused-defines.awk
Noel Grandin 45ec1d9b56 brute-force find-and-remove of unused #define constants.
Change-Id: I7223530ae37297a76654cd00cc1fedb56dbe3adb
2015-01-08 10:39:36 +02:00

19 lines
392 B
Awk

{
x++
y=$0
}
END {
tmp = substr(y, 0, index(y, ":"))
if (x==1) print "sed -i '/[[:space:]]" p1 "[[:space:]]/d' " tmp
}
# | xargs -P 4 -Ixxx sh -c "git grep -w 'xxx' | awk '{ x++; y=\$0 } END { if (x==1) print y }' && echo \"xxx\" 1>&2"
# sed -i '' '/pattern/d'
# | awk 'arr[$0]++ END { for (i in arr) { if(arr[i]==1) print i } }' \
# | awk -f find-unused-defines.awk