Created
September 6, 2012 18:52
-
-
Save marshall/3659427 to your computer and use it in GitHub Desktop.
shell expansion fun
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
# in each case the script sees $1 as the full value (with spaces, or quotes) | |
$ export ABC="a b c" | |
$ ./test.sh "ABC=$ABC" | |
=ABC=a b c= | |
$ export ABC="\"abc\"" | |
$ ./test.sh "ABC=$ABC" | |
=ABC="abc"= |
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
#!/bin/bash | |
echo =$1= | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment