Parsing/passing command line arguments to a bash script - what is the difference between “$@” and “$*”?

前端 未结 3 1032
臣服心动
臣服心动 2020-12-10 06:18

I am using a bash script to call and execute a .jar file from any location without having to constantly enter its explicit path.

The .jar r

3条回答
  •  情深已故
    2020-12-10 06:39

    "$@" corresponds to "$1" "$2" "$3" etc. "$*" corresponds to "$1 $2 $3" which you do not seem to need.

    Without quotes, there is no difference, they both correspond to $1 $2 $3 etc.

提交回复
热议问题