---
title: Counting no. of mailman list subscribers
url: https://sammy.hk/counting-no-of-mailman-list-subscribers/
author: Sammy Fung
published: 2009-02-05T03:18:10+08:00
modified: 2021-06-01T00:43:14+08:00
description: "Just wrote a shell script quickly. It can count number of valid subscribers in every Mailman-driven mailing lists. This piece of code is licensed in GPL. 😉 #!/b…"
categories: ["開放源碼"]
tags: [bash]
source: https://sammy.hk
---
Just wrote a shell script quickly. It can count number of valid subscribers in every [Mailman](http://www.gnu.org/software/mailman/)-driven mailing lists. This piece of code is licensed in [GPL](http://www.gnu.org/licenses/gpl.html). 😉

> \#!/bin/sh
> \# Counting valid no. of list subscribers in mailman
> for i in `list\_lists -b`
> do
> total=`list\_members ${i} | wc -l`
> nomail=`list\_members -n ${i} | wc -l`
> valid=`echo ${total} – ${nomail} | bc -l`
> echo ${i}: ${total} – ${nomail} = ${valid} valid email addrs.
> done

**Running Result:**

> team-a: 123 – 0 = 123 valid email addrs.
> team-b: 456 – 78 = 378 valid email addrs.

### 相關文章：

1. [能否利用軟件工具來加強軟件翻譯效率呢？](https://sammy.hk/%e8%83%bd%e5%90%a6%e5%88%a9%e7%94%a8%e8%bb%9f%e4%bb%b6%e5%b7%a5%e5%85%b7%e4%be%86%e5%8a%a0%e5%bc%b7%e8%bb%9f%e4%bb%b6%e7%bf%bb%e8%ad%af%e6%95%88%e7%8e%87%e5%91%a2%ef%bc%9f/ "能否利用軟件工具來加強軟件翻譯效率呢？")
2. [Linux Forum Asia 2005 之後感](https://sammy.hk/linux-forum-asia-2005-%e4%b9%8b%e5%be%8c%e6%84%9f/ "Linux Forum Asia 2005 之後感")
3. [重新安裝 Serendipity](https://sammy.hk/reinstall-serendipity/ "重新安裝 Serendipity")
4. [近期喜歡上搞 Web Application](https://sammy.hk/interests-to-code-webapp/ "近期喜歡上搞 Web Application")
