in reply to Re: parsing output of UNIX `who` command
in thread parsing output of UNIX `who` command

On Solaris who -q gives one or more lines of space-separated user names followed by a summary line giving total no. of users. I wonder what o/s chinamox is using.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^3: parsing output of UNIX `who` command
by Anonymous Monk on Oct 02, 2006 at 12:11 UTC
    Not on my Solaris.
    $ uname -a SunOS mybox 5.8 Generic_108528-15 sun4u sparc SUNW,UltraAX-i2 $ /usr/bin/who -q anomonk root # users=2 $
      Er ... yes.

      $ /usr/bin/who -q # You run 'who -q' and get ... anomonk root # One or more lines of space-separated user names # users=2 # Followed by a summary line $ # And back to the prompt

      If there are lots of users on a system, who -q will output multiple lines of users rather than wrapping one long line. It looks like it assumes a terminal width of 80.

      Cheers,

      JohnGG