Last active
August 11, 2017 22:09
-
-
Save cardoni/1b6a14793794845d945ea623f2604ec7 to your computer and use it in GitHub Desktop.
Easily Find, Sort, & Dump Environment Variables to Console
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
#!/usr/bin/env bash | |
# handy shortcut(s) to dump environment variables to console log | |
dumpEnvironmentVariables () { | |
userInput="$1" | |
if [[ $userInput ]]; then | |
env | grep -E -i "$userInput" | sort | uniq | |
else | |
env | grep -E -i 'aws|node|nvm' | sort | uniq | |
fi | |
} | |
alias dump-conf=dumpEnvironmentVariables | |
alias dump-configuration=dump-conf | |
alias dump-aws-configuration="dump-conf aws" | |
alias dump-node-configuration="dump-conf node" | |
alias dump-nvm-configuration="dump-conf nvm" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment