$*
–
Positional Parameters
$* expands to a single word, which contains the values of all positional parameters $1, $2, etc.
$@ is similar, but produces multiple values, one for each positional parameter.
Links
Examples
- Print positional parameters as one value
- Output:
1 2set a b for p in "$*"; do echo "value: $p"; done1value: a b - Print positional parameters as multiple values
- Output:
1 2set a b for p in "$@"; do echo "value: $p"; done1 2value: a value: b
BashSuport Pro ist eine Bash und POSIX IDE mit Unterstützung für $* – probieren Sie es aus!