Skip to content

Instantly share code, notes, and snippets.

@AlexDaniel
Created September 25, 2019 08:46
Show Gist options
  • Save AlexDaniel/62a02ee7c322f2ca832a688339ac76c0 to your computer and use it in GitHub Desktop.
Save AlexDaniel/62a02ee7c322f2ca832a688339ac76c0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
files=0
executable=0
shebanged=0
shopt -s globstar
for f in **/*.{p6,pl6,pl}; do
((files++))
[[ -x "$f" ]] && ((executable++))
[[ "$(head -n1 "$f")" == "#!"* ]] && ((shebanged++))
done
echo "Total files: $files"
echo "Executable: $executable"
echo "With a shebang: $shebanged"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment