分类: Python/Ruby
2011-08-24 22:45:22
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]}'`