nusers

Download nusers

 1: #!/bin/bash
 2: # Simple shell script that uses command substitution and an if statement.
 3: # This script has an accompaning man page.
 4: #
 5: # Written 2002 by Wayne Pollock, Tampa Florida USA.
 6: #
 7: # $Id: nusers,v 1.1 2003/03/18 08:37:27 wpollock Exp $
 8: 
 9: COUNT=$(who | wc -l)
10: 
11: if [ "$1" = "-v" ]
12: then
13:     echo There are $COUNT users on the system now.
14: else
15:     echo $COUNT
16: fi