On Wed, 19 Apr 1995, Marko Toivanen wrote:
> Responding to a previous article by Deborah A Hamilton:
> * Also - sorting the large mailing lists by host.domain.name made
> * our mailer more efficient.
>
> So, anybody got a sort program that would sort beginning from the end of
> each line where the most significat domain lies, and would also lock the
> list file to prevent majordomo using while sorting?
here is a bourne shell script, change the first line to use your
mail lists directory. this process all lists as one. no locking sorry,
but it is fast, the odds are in your favor that you wont need locking.
if you want to do one list only remove the "# <===" line and
cat the list to the script 'cat <listname> | sh <script>
:
( cd /home/mail/lists ; ls | fgrep -v . | xargs cat ) | # <====
sed '
/".*"/s///
/.*<\(.*\)>/s//\1/
/[ ]*(.*).*$/s///
' | tr '[A-Z]' '[a-z]' | rev | sort -u | rev | awk '
{ printf ("%70s\n",$1); }
'
now if you were to reorder each list based upon the output of the
above shell script, then every user at site foo.bar.com would be served
before going to the next site. hmmmm....could be good ;)
Jonathan M. Bresler jmb@kryten.atinc.com | Analysis & Technology, Inc.
| 2341 Jeff Davis Hwy
play go. | Arlington, VA 22202
ride bike. hack FreeBSD.--ah the good life | 703-418-2800 x346
References:
|
|