Created
May 23, 2018 01:36
-
-
Save mattolenik/70ae24cfd5898a093e8dcb87eee6a3cb to your computer and use it in GitHub Desktop.
Recursively find shell scripts by detecting shebang
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
# Caveat: grep can't match the beginning of the file, so this will catch files with a shebang on any line, | |
# such as a script being embedded in another kind of file. To get around this each file should be checked with head -n1 | |
grep -Ir '^#!/.*sh' --exclude-dir 'node_modules' --exclude '*.tpl' ./* | awk -F: '{print $1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment