awk之生成shell数组

awk之生成shell数组
ORDER="0f 30 00 22 00 04 02 04 02"
[code]
awk 'BEGIN{split('"\"$ORDER\""',START," ");for(i in START)print "START["i"]="START[i]}'
#生成shell数组
#a.使用eval
eval $(awk 'BEGIN{split('"\"$ORDER\""',START," ");for(i in START)print "START["i"]="START[i]}')
#b.使用圆括号
START=(echo $ORDER)
START=(`awk 'BEGIN{print "'"$ORDER"'"}'`)

你可能感兴趣的:(Awk)