Created
January 9, 2021 05:45
-
-
Save rightson/ed11ebd200b2d4a2228618b78e7f4e0a to your computer and use it in GitHub Desktop.
A function to grep bash function name declared as "function $name () {" pattern
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
grep_function_names () { | |
if [ -e "$1" ]; then | |
grep -E '^function' $1| awk '{print $2}' | sed -r 's/\(|\)|\{|\}//g' | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment