我正在阅读bash脚本解析库以更好地使用bash语法。
使用该库,我可以通过以下方式获得脚本:
x[y]=([z]=w) ls > log
我认为x [y]这是一个数组运算。那么“([[z] = w)””是什么意思?
男子重击:
Arrays are assigned to using compound assignments of the form
name=(value1 ... valuen), where each value is of the form [subscript]=string.
例如:
$ declare -A foo
$ foo=([one]=1 [two]=2)
$ echo ${foo[one]}
1
$ echo ${foo[two]}
2
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句