awk里的各种坑
摘要:
今天又遇到一个,一旦需要定义一个局部数组(awk通过把局部变量定义在函数参数列表来实现局部这一特征)那么这个数组可以正常的操作,但是无法对他取长度,一旦使用length(tempArr)会得到这么一个错误:fatal: attempt to use array `tempArr' in a scalar contextfunction test(__ARGVEND__, tempArr){ for (i=0; i<10; i++) { tempArr[i] = i+1 } # it's right for(j in tempArr) { ... 阅读全文
posted @ 2014-02-25 14:34 codestyle 阅读(602) 评论(0) 推荐(0)
浙公网安备 33010602011771号