Re: [ILUG] Re: Need help with Perl script

From: Nick Murtagh (nick at domain nickmurtagh.com)
Date: Tue 23 May 2000 - 20:06:48 IST


On Sun, 21 May 2000, David O'Callaghan wrote:
> $num_users = `w -h | wc -l`;
> print "There are $num_users logged on to the system.";
>
> Although if there are users logged on multiple times it won't catch
> that and you could get the line count in a perl-ier way...

$num_users = `w -h | cut -f 1 -d ' ' | uniq | wc -l`;



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:06:15 GMT