Created
February 23, 2018 16:01
-
-
Save minrk/527a11b2442d7b3188ed7880cbda6d7c to your computer and use it in GitHub Desktop.
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 | |
# show-args is a Python script that prints sys.argv[1:] | |
echo '$@ =' "$@" | |
echo 'no quotes: $@' | |
show-args $@ | |
echo 'quotes: "$@"' | |
show-args "$@" | |
AT="$@" | |
echo 'quotes: "$AT" where AT="$@"' | |
show-args "$AT" | |
echo 'no quotes: $AT' | |
show-args $AT | |
echo "HOW DOES THAT WORK" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah… i just realised I needed to add args after the invocation:
edit:
$ ./test.sh has space arg 2
and I needed to group the args to get the effect you're seeing:
$ ./test.sh "has space" "arg 2"
I got:
So it looks like I can reproduce… this is so weird.