坑点
字符串展开¶
a="a b" xxx "$a"- 如果是
xxx "$a",则a会作为一个参数传入xxx - 如果是
xxx $a,则a会根据空格展开为2个参数传入xxx - 但如果a是数组如
a=(a b),那么无论是xxx "${a[@]}"还是xxx ${a[@]}都是2个参数传入xxx
- 如果是
![https://images.unsplash.com/photo-1551650975-87deedd944c3?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80]