:
# Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
# 
# Permission to use, copy, modify, and distribute this material 
# for any purpose and without fee is hereby granted, provided 
# that the above copyright notice and this permission notice 
# appear in all copies, and that the name of Bellcore not be 
# used in advertising or publicity pertaining to this 
# material without the specific, prior written permission 
# of an authorized representative of Bellcore.  BELLCORE 
# MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
# OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
# WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.

# Conversion from C shell to Bourne shell
# by Bob Glickstein, Z-Code Software Corp.
# Conversion Copyright (c) 1992 Z-Code Software Corp. (Z-Code)
# 
# Permission to use, copy, modify, and distribute this material for
# any purpose and without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies, and that the name of Z-Code not be used in advertising or
# publicity pertaining to this material without the specific, prior
# written permission of an authorized representative of Z-Code.
# Z-CODE MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY OF
# THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", WITHOUT ANY
# EXPRESS OR IMPLIED WARRANTIES.

if test -z "${X_VIEWER:-}"
then
	X_VIEWER="xloadimage -view -quiet -geometry +1+1"
# X_VIEWER="xv -geometry +1+1"
fi

if test "$1" = "-viewer" -a ! -z "$2"
then
	X_VIEWER=$2
	shift
	shift
fi

if test -z "${DISPLAY:-}"
then
	echo ""
	echo This message contains a picture, which can currently only be
	echo viewed when running X11.  If you read this message while running
	echo X11, you will be able to see the picture properly.
	exit 0
fi

echo NOTE: TO MAKE THE PICTURE WINDOW GO AWAY, JUST TYPE 'q' IN IT.
echo ""

if test -z "$1"
then
	$X_VIEWER stdin
else
	for i in $*
	do
		dir=`echo $i | sed 's-/..*$--'`
		if test ! "$dir" = "$i"
		then
			cd $dir
		fi
		ln $i $$.PRESS-q-TO-EXIT 
		$X_VIEWER $$.PRESS-q-TO-EXIT
		rm $$.PRESS-q-TO-EXIT 
	done
fi
