更新时间:2022-05-11 01:43:47
是的:
ARRAY=()
ARRAY+=('foo')
ARRAY+=('bar')
在赋值语句为 shell 变量或数组索引赋值的上下文中(请参阅数组),+="运算符可用于附加或添加到变量的先前值.
In the context where an assignment statement is assigning a value to a shell variable or array index (see Arrays), the ‘+=’ operator can be used to append to or add to the variable's previous value.