Last active
August 15, 2018 13:46
-
-
Save iNecas/66125191678a940db2806f9ad77d8ff8 to your computer and use it in GitHub Desktop.
Difference between $* and "$@"
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
./test_args.sh "one two" three | |
with $* | |
["one", "two", "three"] | |
with "$@" | |
["one two", "three"] |
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 ruby | |
p ARGV |
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 | |
echo 'with $*' | |
./test_args.rb $* | |
echo 'with "$@"' | |
./test_args.rb "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment