What does $* mean in shell?I have code two function, run_command and run_test, they are called like this:if [ -n `echo ${GOAT_COMMANDS} | grep $1` ]; then  run_command $*else  run_test $*fiI want to understand what $* means, but Google search is very bad for searching these kinds of things.
what does $* mean in shell
shell;shell script
$* is all the parameters to the script or function, split into separate arguments on whitespace.If you have a function:foo() {    for x in $*    do        echo $x    done}then running foo 1 2 3 4 5 will output:12345That is, the quoted string 2 3 4 will be split into three separate words.When you don't want to split the arguments into separate words like that, you can use $@. If the same function used $@ in place of $*, it would output:12 3 45That is, the quoted string would not be split into separate words. This is like listing all the positional parameters out explicitly: $1 $2 $3 $4 .... In general, this is probably the one you want to use - the word-splitting will often lead to nasty bugs that are hard to track down.At the top level of a script (not inside a function), these refer to the arguments given to the script itself.Your example is calling either run_command or run_test with all of the arguments to this script or function, split into separate words. If the script were run as script.sh hello world 2 3 then it would have the effect of running:run_command hello world 2 3