w command gives the user and the below details:
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT USER A abc/0 XX.XXX.XX.XX 14:32 41:10 0.10s 0.10s -bash USER B abc/1 XX.XXX.XX.XX 13:42 2:46 0.10s 0.03s ssh XX.XXX.XX.XX
We try to extract all the data individually like the below but output is not having fixed length data. So looking for alternate command for “w”:
str1[0,0]= USER str1[0,1]= TTY str1[1,0]= USER A str1[1,1]= USER B
Please tell us if we have alternate commands in unix/linux to get the same details as w(list of users and what each user is doing…) .