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

前端 未结 3 1035
臣服心动
臣服心动 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:23

    $* is all parameters as a single word, $@ is all parameters as individual quoted string.

    I usually ends up using "$@", seems to work the best for me.

提交回复
热议问题