Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get all constants in a bash script
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
You can’t perform that action at this time.