#!/bin/csh -f
# ************************************************************************
# *                                                                      *
# *   This C-shell program adds a user to the end of the membrers list.  *
# *                                                                      *
# * ### 30-AUG-2004  add_to_list.csh  v1.1 (c) L. Petrov 14-FEB-2005 ### *
# *                                                                      *
# ************************************************************************
set mem_list  = /home/lists/lcs/list_lcs/members/members.lst
set mem_email = /home/lists/list_lcs/members/members.email
set mem_html  = /home/lists/list_lcs/members.html
set mem_header_html = /home/lists/list_lcs/mem_header.html
set mem_footer_html = /home/lists/list_lcs/mem_footer.html
#
if ($#argv < 2) then 
    echo "Usage: email-address Full_name"
    exit 1
endif
echo $1"			"$2' '$3' '$4' '$5' ' $6' '$7' ' $8 >> $mem_list
#
set date_stamp = `date "+%Y.%m.%d_%H:%M:%S" | tr "[a-z]" "[A-Z]"`
#
if ( -f $mem_email ) rm -f $mem_email
cat $mem_list | awk '{print $1}' > $mem_email 
#
if ( -f $mem_html ) rm -f $mem_html
cat $mem_header_html > $mem_html
cat $mem_list | awk '{print "    <LI>"$2" "$3" "$4" "$5" "$6" "$7" "$8" </LI>"}' >> $mem_html
cat $mem_footer_html | sed s/"@1@1@1@1@1@1@1@1@1@1"/$date_stamp/ >> $mem_html
#
# chmod o=r,g=rw  $mem_list $mem_email $mem_html
#
echo "The list is updated"
