Last active
December 28, 2015 08:19
-
-
Save wteuber/7470507 to your computer and use it in GitHub Desktop.
find ruby files without instructions
This file contains hidden or 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
| # FIND: | |
| find . -type f -name "*.rb" | while read filename; do if [ "0" -ne "`expr length "\`ruby --dump insns $filename | tail -n +2 | tr -d "\n " | grep -oue "^0000putnil([^)])[^l]*leave$"\`"`" ]; then echo $filename; fi; done | |
| # REMOVE: | |
| find . -type f -name "*.rb" | while read filename; do if [ "0" -ne "`expr length "\`ruby --dump insns $filename | tail -n +2 | tr -d "\n " | grep -oue "^0000putnil([^)])[^l]*leave$"\`"`" ]; then echo $filename; fi; done | xargs rm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment