在shell中传递带有空格的参数有以下几种方法:
$ command "parameter with spaces"
$ command parameter\ with\ spaces
$ command=("parameter" "with" "spaces")
$ command parameter with spaces
注意:在shell中,单引号和双引号的使用有一些差别。单引号会保留参数中的所有特殊字符,而双引号会将其中的变量展开。因此,如果参数中包含有变量,使用双引号进行包裹。
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: shell怎么获取进程的进程号