OT: Bash script for Mailman export of email addresses

Nils Kassube kassube at gmx.net
Tue Jan 15 07:07:28 UTC 2013


Nigel Ridley wrote:
> Due to circumstances beyond my control I have to move my personal
> mailing list from Mailman to another mailing solution.
> I need to export all the email addresses for my subscribers to a csv
> file and have found a one-liner bash script that is supposed to do
> it but it spits out an error message. The webpage for the script is
> here:
> http://literalbarrage.org/blog/2011/11/14/export-mailman-subscriber-a
> ddress-lists-without-sshshell-access/
> 
> The actual script is:
> wget -O - --post-data 'adminpw=${admin password}'  http://${listserv
> domain name}/admin.cgi/${list name}/members | egrep "_realname" |
> sed 's/^.*value="\([^"]*\)".*value="\([^"]*\)".*$/\1,\2/' | sed
> 's/%40/@/' > maillist.csv
> 
> The error I get is:
> bash:
> http://${box220.bluehost.com/mailman/admin/**********/}/admin.cgi/${
> *********}/members: bad substitution

I think you should use the proper values directly where ${whatever} is 
used in the script. Otherwise you should use real variable names without 
spaces. Something like

listserv=box220.bluehost.com
listname=somelistname
adminpassword=myverysecretpassword
wget -O - --post-data adminpw=${adminpassword} \
http://${listserv}/admin.cgi/${listname}/members | .....


Nils




More information about the kubuntu-users mailing list