This command
echo \"hello world\" | awk \'{split($0, array, \" \")} END{print length(array) }\'
does not work for me and gives this error m
sample on MacOSX Lion to show used ports (output can be 192.168.111.130.49704 or ::1.49704) :
netstat -a -n -p tcp | awk '/\.[0-9]+ / {n=split($4,a,"."); print a[n]}'
In this sample, that print the last array item of 4th column : "49704"