echo "There are `w -sh | cut -f1 -d" " | sort | uniq -c | grep -ic "^."`
users logged on the system."
this will make sure the same user logged on multiple times will only be
counted once.
-----Original Message-----
From: Tina Marie [mailto:TinaDp6 at netscape.net]
Sent: Monday, May 01, 2000 6:14 PM
To: ilug at linux.ie
Subject: [ILUG] Re: Need help with Perl script
I need to have the number of users printed out within my perl script.
I know the UNIX command is w -h | wc -l
But how do I get it to print out like the sample below?
There are 7 users logged on the system.
Tina
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at
http://webmail.netscape.com.
--
Irish Linux Users' Group: ilug at linux.iehttp://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
List maintainer: listmaster at linux.ie
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!