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之生成shell数组
最新推荐文章于 2024-06-12 19:09:40 发布