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]>
Thu, 20 Nov 2003 15:27:01 -0500
text/plain (69 lines)
Sean Yo wrote:

> Under 1.8e I am able to query what lists a user owns with the
>
> lists own by [log in to unmask]
>
> command.  Is there a way to do this under 1.8d?
> If not, any suggestions on the best way to figure out what lists an
> account owns und 1.8d?
>
> Cheers
> Sean
>

The 'lists owned by' command was introduced in version 1.8e.

We run LISTSERV 1.8d on Solaris 2.8, and use the following perl script to
find all lists owned by a specific owner. The script must be run on the
LISTSERV server. It searches all .list files in the listserv/home
directory for "Owner=" statements containing the specified email address.
You will almost certainly have to modify the statement that specifies
the full path to the listserv/home directory.

No warranties express or implied. Your mileage may vary. Offer not valid with
any other coupons. Yah-dah, Yah-dah. Enjoy.

----- begin code -----
#!/bin/perl -w

$count = @ARGV;

if ( $count != 1 ) {
         print STDOUT "$0 cancelled - missing or invalid argument: @ARGV\n";
         print STDOUT "Correct syntax: $0 listowner-email-address";
         exit;
}

($#ARGV < 0 ) and die "Usage: $0 <email-address-of-owner-to-find-in-lists>\n";

$home_dir="/usr/products/listserv/home";

chdir $home_dir;

opendir(DIR,".") or die "Unable to open listserv directory: $!";

@files=grep (/.*\.list$/,readdir(DIR));

closedir(DIR);

print "Searching for lists owned by $ARGV[0]\n";

foreach $filename ( @files ) {
         open (CUR,$filename) or
                 die "Unable to open $home_dir/$filename\n";
         while ( <CUR> ) {
                 (/Owner=[^*]*$ARGV[0]/io)
                 and print "$filename\n";
         }
         close CUR;
}

exit;
----- end code -----

--
Paul Russell
Senior Systems Administrator
University of Notre Dame

ATOM RSS1 RSS2