#!/bin/sh
#
# Date: Mon, 26 Oct 87 01:07:12 EST
# To: NeWS-makers@brillig.umd.edu
# Subject: Remote `psterm' shell script for NeWS
# From: Greg Earle <earle@mahendo.Jpl.Nasa.Gov>
# 
# Here's something you might find handy.  If you have the newer version of
# `psterm' that Sam Leffler announced (available via anonymous FTP from host
# Columbia.EDU), then toss this into your /usr/NeWS/bin.  See the comments
# for what it does.
# 
# 	Greg Earle		earle@mahendo.JPL.NASA.GOV
# 	S(*CENSORED*)t		earle%mahendo@jpl-elroy.ARPA	[aka:]
# 	Rockwell International	earle%mahendo@elroy.JPL.NASA.GOV
# 	Seal Beach, CA		...!cit-vax!elroy!jplgodo!mahendo!earle
# 
# Remote psterm shell script
# Takes one mandatory argument, namely remote host to execute psterm on
# Optional second argument is terminal type (default h19)
# Sends window back to the current host
# Requires the new Sam Leffler-ized `psterm', sorry (Needs `-bg' to background)
# I think this is the `psterm' that made it into NeWS 1.1
# It is available for anonymous FTP from columbia.EDU
#
PATH=${PATH}:/usr/NeWS/bin: ; export PATH
HOSTNAME=`hostname` ; export HOSTNAME
NEWSHOME=/usr/NeWS/bin ; export NEWSHOME
TTYTYPE=${2-h19} ; export TTYTYPE
if [ $# = 0 ] || [ $# -gt 2 ]
then
	echo usage: rpsterm remote-host [ terminal-type ]
	exit 1
fi
rsh $1 "setenv PATH ${PATH}:$NEWSHOME ; \
	setenv NEWSSERVER '`setnewshost $HOSTNAME`' ; \
	psterm -f -bg -t $TTYTYPE -xy 0 405 -fl 'Remote psterm on $1' -il $1"
unset TTYTYPE
unset HOSTNAME
exit 0
