Skip to content

Instantly share code, notes, and snippets.

@marshall
Created September 6, 2012 18:52
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 marshall/3659427 to your computer and use it in GitHub Desktop.
Save marshall/3659427 to your computer and use it in GitHub Desktop.
shell expansion fun
# 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"=
#!/bin/bash
echo =$1=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment