LSTSRV-L Archives

LISTSERV Site Administrators' Forum

LSTSRV-L

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Paul Russell <[log in to unmask]>
Mon, 7 May 2001 03:29:51 -0400
text/plain (38 lines)
Alternatively, you could grep the output from listview. I use this
technique to count subscribers, to identify lists with potential
problem configurations, such as unconfirmed open subscription,
"review=public", or "send=public", to search all lists for an address,
regardless of whether it appears as an owner, editor, or subscriber, and
to generate a list of list owners, among other things.

Appended below is a quick-and-dirty shell script to count subscribers
using the output of listview. If you specify a listname, it will count
the subscribers on the specified list. If you do not specify a listname,
it will count the subscribers on every list on the server.

----- 8< cut here >8 -----
#!/bin/sh -e
# Name: ls_count
# Purpose: Count subscribers on each list
# Author: Paul Russell
if [ $# = 0 ]
then
        listname="*"
else
        listname=$1
fi
old_pwd=$PWD
cd /listserv/home
for i in $listname.list;
do
        count=`/listserv/bin/listview $i | grep -v "^*" | wc -l`
        echo "$count $i";
done
cd $old_pwd
----- 8< cut here >8 -----

--
Paul Russell
Senior Systems Administrator
University of Notre Dame

ATOM RSS1 RSS2