[Mailman-Users] Script problem

Todd Zullinger tmz at pobox.com
Tue Jul 4 01:11:03 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jewel wrote:
> I am trying to write a script which will email me a list of all the 
> lists and their members.

The script below will only output a count of list members (that's what
the |wc -l does).

> I was able to find the following below but keep getting errors when
> I try and execute it.

What are the errors?

> I have made the file executable.

You'd also need to include a #!/path/to/your/shell at the top,
probably #!/bin/sh in this case.

>    for i in `/usr/local/mailman/bin/list_lists -b`;
>    do
>      j=`/usr/local/mailman/bin/list_members $i |wc -l`
                                                 ^^^^^^
Remove the |wc -l if you want to get the list members.  With the -l
option, wc will simply print the number of lines in the output it's
given.

I think this is more like what you're asking for:

#!/bin/sh

for list in `/usr/local/mailman/bin/list_lists -b`; do
    echo "$list members:"
    /usr/local/mailman/bin/list_members "$list"
    echo
done

You could also create a separate email for each list which might make
it easier to keep track of once it reached your mailbox.  There are
probably some scripts like this in the FAQ, and there are surely some
in the list archives.  Jon Carnes posted some way back, IIRC.

- -- 
Todd        OpenPGP -> KeyID: 0xD654075A | URL: www.pobox.com/~tmz/pgp
======================================================================
Everyone needs to believe in something. I believe I'll have another
beer.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)
Comment: When crypto is outlawed bayl bhgynjf jvyy unir cevinpl.

iG0EARECAC0FAkSppAcmGGh0dHA6Ly93d3cucG9ib3guY29tL350bXovcGdwL3Rt
ei5hc2MACgkQuv+09NZUB1plGACeOnGm0E3XF49YbTJKRWX0eSGkG38An3fXl4BC
tl8gXskTEe+/EjPVdbLJ
=qO/Q
-----END PGP SIGNATURE-----



More information about the Mailman-Users mailing list