Created
October 10, 2014 12:25
-
-
Save rk295/cd4244346a8c858c8318 to your computer and use it in GitHub Desktop.
bash variable foo
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
$ export foo=bar | |
$ export "baz"$foo=wibble | |
$ echo $bazbar | |
wibble |
Sorry, also forgot about this:
foo=bar
bar=baz
echo $foo # bar
echo ${!foo} # baz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you are potentially assigning quotes, special shell characters and spaces, I would suggest a slightly different approach.
Works better for odd things like the following.