Skip to content

Instantly share code, notes, and snippets.

@casjay
Created August 15, 2020 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save casjay/f4d126b1995e8a895b310e9fdfb9187a to your computer and use it in GitHub Desktop.
Save casjay/f4d126b1995e8a895b310e9fdfb9187a to your computer and use it in GitHub Desktop.
find all variables in a shell script
awk '/[A-Za-z0-9]+=/ { gsub(/=.*/,"",$0); print $NF; }' filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment