Home > OS >  The difference between $@ in the shell and $*
The difference between $@ in the shell and $*

Time:09-30

Accurately speaking, only if the soft is both have a difference in the quote, otherwise, said "all parameters" (excluding $0),
If run on the command line. My sh p1 "p2 p3 p4,
Whether $@ or $*, just can get p1 p2 p3 p4,
However, if in soft words in the quote:
"$@" available "p1" "p2 p3" "p4" section of the three different words (word).
"$*" available "p1 p2 p3 p4" this a whole bunch of single word,
In the understanding of simple point,
Is a list in $@
$* is whole line of string,
This is a forward others,
  • Related