Skip to contentSkip to conversation

feature request: mlmmj-list

DISCUSSION Kurt Lieber 2 participants 4 messages Nov 4, 2004 – Nov 12, 2004

lore
Share & tools
lore
#0 lore raw

One of the nice utilities in ezmlm is ezmlm-list. It lists all subscribers on a particular list and also has an option (-n) to list just a count of all subscribers.

I've attached the man page for reference. It has a number of other options, including SQL support, but I'm personally mainly interested in the -N and -n options.

I realize this is something that can be done via a bash script (and that's what we're going to do for now) but as a longer term "nice to have", it would be...well...nice to have. :)

--kurt

#1 lore raw
Quoted 11 lines · Kurt Lieber

One of the nice utilities in ezmlm is ezmlm-list. It lists all subscribers on a particular list and also has an option (-n) to list just a count of all subscribers.

I've attached the man page for reference. It has a number of other options, including SQL support, but I'm personally mainly interested in the -N and -n options.

I realize this is something that can be done via a bash script (and that's what we're going to do for now) but as a longer term "nice to have", it would be...well...nice to have. :)

I know that one very well, and I thought of it already.

The only reason I could think of to do this is the -n switch. Fair enough--it'll happen before 1.1.

Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                -- A. P. J.
#2 lore raw
In reply to Kurt Lieber
Quoted 2 lines · Mads Martin Joergensen

The only reason I could think of to do this is the -n switch. Fair enough--it'll happen before 1.1.

yeah, we use the -n switch all the time. I've attached a simple bash script that does everything I need it to. It does basic checking, but it's by no means "robust". It looks like you'd expect a 10-minute bash script to look. :)

Anyway, in case it's helpful to anyone else, have a blast. No warranty, blah blah blah.

--kurt

#!/bin/bash

ARGS=1
COUNT=0

b_CAT=/bin/cat
b_WC=/bin/wc

if [ $# -lt "${ARGS}" ]
then
echo "Usage: mlmmj-list [-n] <listname>"
exit 1
fi

if [ $1 = "-n" ]; then
COUNT=1
PATH=${2%/}
else
PATH=${1%/}
fi

if [ ! -d "${PATH}" ] || [ ! -r "${PATH}" ]; then
echo "${PATH} is not a directory or is not readable" exit 1
fi

if [ ${COUNT} -eq 1 ]; then
${b_CAT} ${PATH}/subscribers.d/* | ${b_WC} -l
else
${b_CAT} ${PATH}/subscribers.d/*
fi

#3 lore raw
In reply to Kurt Lieber
Quoted 10 lines · Kurt Lieber
Quoted 2 lines

The only reason I could think of to do this is the -n switch. Fair enough--it'll happen before 1.1.

yeah, we use the -n switch all the time. I've attached a simple bash script that does everything I need it to. It does basic checking, but it's by no means "robust". It looks like you'd expect a 10-minute bash script to look. :)

Anyway, in case it's helpful to anyone else, have a blast. No warranty, blah blah blah.

$ ./mlmmj-list -V -h
mlmmj-list version 1.1.0-RC2
$ ./mlmmj-list -h
Usage: ./mlmmj-list -L /path/to/listdir [-d] [-h] [-n] [-N]
 -h: This help
 -L: Full path to list directory
 -d: Print for digesters list
 -N: Print for nomail version of list
 -n: Print subscriber count
 -V: Print version
$ file ./mlmmj-list
./mlmmj-list: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV),
for GNU/Linux 2.4.1, dynamically linked (uses shared libs), not stripped

:-)

Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                -- A. P. J.