Last active
March 7, 2017 08:38
-
-
Save jpluimers/baad4455ccf47d37fdb774e7dccff35c to your computer and use it in GitHub Desktop.
via http://pisil.de/events.txt, http://pisil.de/events2.txt and https://plus.google.com/104338753868462610772/posts/HAxrsfqwV2w
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Be careful with scripts, always do your backup or play on a copy | |
# Finding abandoned events | |
for i in `find . -name "*.pas" -type f`; do if [ -f ${i%.*}.dfm ]; then cat $i | grep "(Sender: TObject" | grep -v "\." | sed -e "s/\(.*\)\ \(.*\)(\(.*\)/\2/g" | xargs -n1 -I @@ sh -c "echo -n \"${i%.*}.dfm->@@: \"; grep -s -c @@ ${i%.*}.dfm" |grep ": 0"; fi; done | |
# Finding events with every other occurence than "1" | |
for i in `find . -name "*.pas" -type f`; do if [ -f ${i%.*}.dfm ]; then cat $i | grep "(Sender: TObject" | grep -v "\." | sed -e "s/\(.*\)\ \(.*\)(\(.*\)/\2/g" | xargs -n1 -I @@ sh -c "echo -n \"${i%.*}.dfm->@@: \"; grep -s -c @@ ${i%.*}.dfm" |grep -v ": 1"; fi; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !!! Be careful with scripts, always do your backup or play on a copy !!! | |
# Finding abandoned events v2 | |
for i in `find . -name "*.pas" -type f`; do if [ -f ${i%.*}.dfm ]; then cat $i | \ | |
sed -nr "/=(\s)*class/I,/(private|protected|public|published|automated)/I{p}" | \ | |
sed -nr "/procedure/Ip" | \ | |
sed -e "s/\(.*\)\ \(.*\)(\(.*\)/\2/g" | \ | |
xargs -n1 -I @@ sh -c "echo -n \"${i%.*}.dfm->@@: \"; grep -i -s -c @@ ${i%.*}.dfm" | \ | |
grep ": 0"; fi; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment