相关疑难解决方法(0)

Set awk array on command line?

I know the -v switch can be used to awk on the command line to set the value for a variable.

Is there any way to set values for awk associative array elements on the command line?

Something like:

awk -v myarray[index]=value -v myarray["index two"]="value two" 'BEGIN {...}'
Run Code Online (Sandbox Code Playgroud)

shell options awk associative-array

7
推荐指数
1
解决办法
1475
查看次数

标签 统计

associative-array ×1

awk ×1

options ×1

shell ×1