Positional Parameters

$@ expands to the positional parameters $1, … producing one field for each parameter.

$* is similar, but only produces a single value, which contains all values at once.

Examples

Print all positional parameters :

1
2
set a b
for p in "$@"; do echo "value: $p"; done

Output: value: a and value: b.

BashSupport Pro 是一个 支持 $@ 的 Bash 集成开发工具 – 马上试用!
© 2020–2022 Joachim Ansorg
声明
隐私政策
许可条款