Created
June 8, 2015 14:49
-
-
Save e-minguez/5ed00fd3c8c0fb7fc254 to your computer and use it in GitHub Desktop.
Get all constants in a bash script
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
cat ${FILE} | grep -o "\"*\$[{]*[[:upper:]]\{1,\}.*[}]*\"*" | sed -e 's|\(.*\):.*|\1|g' -e 's|[\"|{|\$]||g' -e 's|\(.*\)[[:blank:]].*|\1|g' -e 's|\(.*\)}.*|\1|g' -e 's|\(.*\)[[:blank:]]\].*|\1|g' | sort | uniq | grep -v [[:lower:]] | tr '\r\n' ' ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment