how to grep awk or sed the first row and column
Need to pipe the data from who command to get the info from the first row and column I know how to get the info from a entire column using awk '{ print $1 }'also I do know about the whoami id command just using who as a example
minixr console Mar 21 18:28 minixr ttys000 Mar 21 20:42 v1=$(who | ?) |
Code:
who | head -1 | awk '{print $1}' |
awk gives you the record number - simply test it prior to the print.
|
All times are GMT -5. The time now is 04:23 PM. |