From: The List Server Administrator at UNH <listadm@metaphor.unh.edu>
                                           (currently Bill Costa)

NOTES from author:

      Here's an example I created for someone to send two different 
      language welcomes depending upon the list being subscribed to.
      The same technique could be used to do what you want.  Let me
      know if you have any questions about how this works.  Note that
      it uses Perl; sorry I don't have a shell script example handy.


###### Begin script

#!/usr/local/bin/perl
#
#         File: /usr/users/server/welcome.global
#  Description: Global welcome file for subscription to a list.
#      Version: 1.00
#
#  When a new ListProc subscription is successfully entered, this script
#  is executed and the output is sent to the new subscriber.  The user's
#  request is piped to STDIN, and the following arguments are passed:
#
#  0: The list's name
#  1: the list's address
#  2: The owner's address
#  3: The server's address for requests
#  4: The address the user has been subscribed with
#  5: The user's initial password
#  6: A boolean: 1 if the system accepts live connections; 
#                0 otherwise
#  7: A boolean: 1 if the list allows change of subscription address; 
#                0 otherwise
#  8: The value of the LPDIR environment variable
#
#
#  To control language output, place an emtpy file named either:
#
#         .local-spanish
#   or    .local-english
#
#   in each list's directory.
#
#==============================================================================

#-----------------------------------------------+
# Suck-in all of STDIN into a single string.	|
#-----------------------------------------------+

     $stdInLines  = "";
     $stdInLines  = $stdInLines . $_ while (<STDIN>);


#-----------------------------------------------+
# Capture our command line arguments.		|
#-----------------------------------------------+

					#-- Parameters supplied by caller -----
     $listSpec    = $ARGV[0];		# This is ALL CAPS version of $listName
     $listAddr    = $ARGV[1];		# This is mixed case, use this instead.
     $ownerAddr   = $ARGV[2];		# This owner's real addr, don't use it.
     $serverAddr  = $ARGV[3];		# ListProc's own address, replace it.
     $userAddr    = $ARGV[4];		# How the user is subscribed.
     $passWord    = $ARGV[5];		# User's initial password.
     $liveConnect = $ARGV[6];		# True if live connections allowed.
     $addrChange  = $ARGV[7];		# True if user can change own address.
     $lpDir       = $ARGV[8];		# /usr/users/server (our home dir).
					#
					#-- Edit some of these parameters -----
     ($listName,			# Extract the list name from the 
      $domainName) = split(/\@/,	# full address since the character
                           $listAddr);	# casing is preserved unlike Arg 0.
					#
     $ownerAddr   = ($listName 		# Build the owner's return address
                  .  "-request\@" 	# from the list address.
                  .  $domainName);	#
					#-- Misc stuff ------------------------

      $serverAddr = "ListProc\@lists.local.edu";	# Server address.
       $listAdmin = "List.Admin\@local.edu";		# List admin address.
         $listDir = "$lpDir/lists/$listSpec";		# Where the list lives.
                                                        # -- Flag Files -------
       $isEnglish = "$listDir/.local-english";		# English and Spanish
       $isSpanish = "$listDir/.local-spanish";		#  flag files.


#-------------------------------+
# Test for Spanish, default to	|
# English.			|
#-------------------------------+

     if ( -e $isSpanish ) { print <<SPANISH_WELCOME;

     Spanish welcome text goes here.  Use variables like so:

     The subscription request:

        $stdInLines

     has successfully been processed.

     You have been subscribed to the $listName mailing list.  Your
     initial password is $passWord.

     For help with this list, contact the list owner at:

        $ownerAddr

     etc. etc. 

SPANISH_WELCOME
      
    } else { print  <<ENGLISH_WELCOME;

    Same idea here only in English. :-)

ENGLISH_WELCOME
    }


#==============================================================================
# EOF: welcome.global  ========================================================
#==============================================================================
