I have a to write a script that remove the Idle column from the output of finger.
>finger
Login    Name                 TTY  Idle  Login  Time   Office  Phone
Billy    Billy Howard        *con  6:55  Fri    19:03
Billy    Billy Howard         s00     5  Fri    19:11
Billy    Billy Howard         s00        Sat    00:27
I tried remove the extra spaces with tr and then using cut with a delimiter of a space to remove the column, but since Idle can have no value I sometimes get the wrong value since tr delimited the spaces were the idle time should be... Does anyone know how I can remove the Idle column?
This might work for you:
finger |  sed 's/\(.\{35\}\)...../\1/'
or this:
finger |  cut --complement -c36-40 
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With