[comp.windows.news] exporttonews script

ciemo@bananapc.wpd.sgi.com (Dave Ciemiewicz) (06/09/89)

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

----- CUT HERE ----------------------------------------------------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by ciemo on Thu Jun  8 09:44:57 PDT 1989
# Contents:  exporttonews
 
echo x - exporttonews
sed 's/^@//' > "exporttonews" <<'@//E*O*F exporttonews//'
#! /bin/sh

#
#  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
@//E*O*F exporttonews//
chmod u=rwx,g=rx,o=rx exporttonews
 
exit 0
----- CUT HERE ----------------------------------------------------------------