OT: Bash script for Mailman export of email addresses

Nigel Ridley nigel at prayingforisrael.net
Tue Jan 15 08:54:21 UTC 2013


On 01/15/2013 09:07 AM, Nils Kassube wrote:
> 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
>

Hi Nils,

I did use real variable names without spaces:
wget -O - --post-data 'adminpw=${myverysecretpassword}' 
http://${box220.bluehost.com/mailman/admin/mypersonalmailinglist/}/admin.cgi/${mailinglistname}/members 
| egrep "_realname" | sed 's/^.*value="\([^"]*\)".*value="\([^"]*\)".*$/\1,\2/' | sed 's/%40/@/' 
 > maillist.csv

Is that what you meant?

Nigel




More information about the kubuntu-users mailing list