分类: Python/Ruby
2015-03-11 22:31:58
原文地址:AWK中split函数的用法 作者:中原小伙
The awk function split(s,a,sep) splits a string s into an awk array a using the delimiter sep.
# = 12 34 56
set hms = `echo $time | awk '{split($0,a,":" ); print a[1], a[2], a[3]}'`
set hms = `echo $time | awk '{split($0,a,":" ); for (i=1; i<=3; i++) print a[i]}'`