Last active
March 11, 2019 16:36
-
-
Save pwillis-els/4652e1abb318b5a8f93896331f72331a to your computer and use it in GitHub Desktop.
Scrape and print the variables used in a shell 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 foo.sh | perl -lne 'print $1 if /\$\{?([a-z0-9_]+)\}?/i' | sort -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment