04-Dec-03 at 15:43, Dennis Black ([EMAIL PROTECTED]) wrote : > John, this works for me. > > #!/bin/sh > #Synch two smaller lists with a larger list. > #If more than two, adjust 'wk' numbers. > /home/mailman/bin/list_members the-a-list > /tmp/abc.wk1 > /home/mailman/bin/list_members the-b-list >> /tmp/abc.wk1 > cat /tmp/abc.wk1 | tr '[A-Z]' '[a-z]' > /tmp/abc.wk2 > uniq -u /tmp/abc.wk2 > /tmp/abc.wk3 > uniq -d /tmp/abc.wk2 >> /tmp/abc.wk3 > sort -d /tmp/abc.wk3 > /tmp/abc.wk4 > /home/mailman/bin/sync_members -w=no -f /tmp/abc.wk4 the-big-list > > The '-w=no' means 'don't send the welcome message.' > Cron the above at your desired frequency.
Hmmm uniq -u means print only unique lines. uniq -d means only duplicate lines. uniq only works well if sort is applied first. add_members / sync_members will ignore dupes anyway (but sort then uniq might be quicker). tr is not obligatory but I can see what you're getting at (changing case so that everyone's emails are in lower case for both lists). I'd do something a bit more like (replace $prefix with path to mailman) # get member lists into the temp file $prefix/bin/list_members the-a-list > /tmp/abc.wk1 $prefix/bin/list_members the-b-list >> /tmp/abc.wk1 # convert everything to lower case tr '[A-Z]' '[a-z]' < /tmp/abc.wk1 > /tmp/abc.wk2 # deduplicate from 2nd temp file and overwrite 1st temp file, to save # counting upwards all the time; we could do this on one line and pipe # to another pipe and so on... but separating isn't such a bad thing sort -d /tmp/abc.wk2 | uniq > /tmp/abc.wk1 # now sync back to the list $prefix/bin/sync_members -w=no -f /tmp/abc.wk1 the-big-list Regards, -- Simon White. Internet Consultant, Linux/Windows Server Administration. email, dns and web servers; php javascript perl asp; MySQL MSSQL Access Bridging the gap between management, HR and the tech team. ------------------------------------------------------ Mailman-Users mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ This message was sent to: [EMAIL PROTECTED] Unsubscribe or change your options at http://mail.python.org/mailman/options/mailman-users/archive%40jab.org