Created
June 12, 2016 05:51
-
-
Save leohacker/e701ff3d00c0e52035bbed96d86af1f7 to your computer and use it in GitHub Desktop.
Indirect reference in bash ( check a variable if its value as variable is set )
This file contains hidden or 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
# varname=USER or PROFILE_PATH | |
# $varname == USER | |
# $$ pid of current process | |
# \$$varname == $USER in literal | |
# eval variable=..... evaluate and assign to variable | |
eval variable=\$$varname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment