What does $*
exactly mean in a shell script?
For example consider the following code snippet
$JAVA_HOME/bin/java/com/test/Testclass $*
What does $*
exactly mean in a shell script?
For example consider the following code snippet
$JAVA_HOME/bin/java/com/test/Testclass $*
It's easy to find answer by yourself:
man bash
→/\$\*
:It means all the arguments passed to the script or function, split by word.
It is usually wrong and should be replaced by
"$@"
, which separates the arguments properly.$*
expands to all parameters that were passed to that shell script.$0
= shell script's name$1
= first argument$2
= second argument ...etc$#
= number of arguments passed to shellscript