On Sat, Apr 27, 2002 at 01:30:27PM +0200, Gyelt Tuinstra wrote:
Hi,
Can anyone please give me a pointer or example: I would like my non-technical list-subscribers to be able to easily switch between a normal and a digested list. So that when they subscribe to one, while already subscribed to the other, the original subscription is (silently) removed.
Thanks for the responses. This is what I did: I edited .bin/subscribe (#$Id: subscribe,v 1.36) and added line 132 to add a hook: . ~/.bin/switchdigest.sh switchdigest.sh is a quick _bash_ script (see below) that works on my system, but probably not for everyone. It's just that I'm more used to bash and don't need more compatibility than this. I'd like your comments, though, on how it could fit beter into the rest of smartlist. Gyelt -------------------------- # 20020430 Gyelt Tuinstra gyelt@xs4all.nl # # status: experimental # # This bash-script is called from smartlists .bin/subscribe # It will delete the subscriber from the list/dist and list/accept file if # he subscribes to the list-digest and v.v. # # It is assumed that the list and its digest exist. # This script expects to be started from the subscribe-script (line 132) # The name of the digested list should be the listname with # something appended (variable DIGESTSUBSTRING) # # See the manual to make sure that one subscribed to the digest can also # post. # # todo: # if someone unsubscribes it may be to the wrong list # respect the "above this line" line in dist and accept files # be verbose to sender # # variables uppercase, as smartlist uses lowercase # ( # to debug #set #set -xv DIGESTSUBSTRING="-digest" WHO=$subscraddr if [ -z "$list" ] then # simple sanity check echo Environment not right, not started from .bin/subscribe? exit 1 fi if [ -z "$undigested_list" ] then # if $undigested_list doesn't exist, user wants normal # list EDITLIST="${list}${DIGESTSUBSTRING}" else # meaning: substract de length of the digestsubstring # from the digest-listname EDITLIST=${list:0:${#list}-${#DIGESTSUBSTRING}} fi grep -q $WHO ~lijst/$EDITLIST/dist if [ $? -eq 0 ] then ed ~lijst/$EDITLIST/dist <<-EOF /^$WHO$ d w q EOF grep -q $WHO ~lijst/$EDITLIST/accept if [ $? -eq 0 ] then ed ~lijst/$EDITLIST/accept <<-EOF /^$WHO$ d w q EOF fi fi ) >/tmp/swd.log 2>&1 --------------------------------------------