#! /bin/sh

# Date: Thu, 8 Jun 89 15:57:50 EDT
# To: NeWS-makers@brillig.umd.edu
# Subject: exporttonews script
# From: sgi!ciemo%bananapc.wpd.sgi.com@ucbvax.Berkeley.EDU  (Dave Ciemiewicz)
# 
# The 4Sight news_server from SGI is started up for a user at the time of
# login.  Unfortunately, 4Sight is started before a user's .login or .profile
# is read in.  This means that a user's custom environment variables are
# not in 4Sight's environment.  Sometimes NeWS applications from the net
# break in 4Sight because the applications assume certain environment variables
# will be set.
# 
# Enter "exporttonews".  This simple script is modeled on the Bourne shell
# command "export".  "exporttonews" allows users to export environment 
# variables for their personal environment into 4Sight's (the NeWS server's)
# environment.
# 
# Here's a shar file of exporttonews.  I think you'll find "exporttonews"
# self documenting.
# 
# 					--- Dave

#
#  NAME
#	exporttonews - export environment variables to 4Sight's
#	 	(the news_server's) environment
#
#  SYNOPSIS
#	exporttonews environmentvarname ...
#
#  DESCRIPTION
#	On SGI machines, 4Sight (the news_server) is started up before a
#	user's .profile or .login configuration file is processed so the
#	4Sight has no notion of the user's custom environment.
#
#	exporttonews will take exported environment variables and place them
#	in the 4Sight's environment.
#
#  EXAMPLE
#	In your .profile (sh,ksh), you might export your PATH.
#
#		PATH=$PATH:'/additional/path'
#		export PATH
#		exporttonews PATH
#
#	In your .login (csh,tcsh), you might export your path.
#
#		set path ($path /additional/path)
#		exporttonews PATH
#  NOTE
#	The variables specified to exporttonews must be exported to the
#	environment.
#
#  AUTHOR
#	Dave Ciemiewicz (ciemo@sgi.com), Silicon Graphics, 1988
#

for environmentvar in $*
do
    eval value=$"$environmentvar"
    echo "($environmentvar) ($value) putenv" | psh
done
