Skip to content

Instantly share code, notes, and snippets.

@hraban hraban/output.txt
Last active Aug 23, 2017

Embed
What would you like to do?
(bash) Comparing $* and $@
$ /tmp/test.sh
$*: []
"$*": ['']
$@: []
"$@": []
$ /tmp/test.sh a b "c d"
$*: ['a', 'b', 'c', 'd']
"$*": ['a b c d']
$@: ['a', 'b', 'c', 'd']
"$@": ['a', 'b', 'c d']
#!/bin/bash
echo -n '$*: ';
python -c 'print __import__("sys").argv[1:]' $*
echo -n '"$*": ';
python -c 'print __import__("sys").argv[1:]' "$*"
echo -n '$@: ';
python -c 'print __import__("sys").argv[1:]' $@
echo -n '"$@": ';
python -c 'print __import__("sys").argv[1:]' "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.