Hi,
Need some help with awk and blank fieds..
[root@host1 ~]# last -n 2
gml4410 pts/0 host3 Fri Nov 18 07:46 - 07:53 (00:06)
nmc5060 host2 Thu Nov 17 15:29 - 15:30 (00:00)
I need to extract field1(userid) , field5(month) and field 6(day).
Notice the second line has blank space in 3rd field. so my awk gets the wrong fields.
[root@host1 ~]#last -n 2 | awk '{print $1,$5,$6}'
gml4410 Nov 18 == This is what I need.
nmc5060 17 15:29