#! /bin/csh -f
#
# run.os4
# 8/10/89
# This script executes the binary version of its namesake
# for the type of machine which calls it.  This script
# can be linked to any program name using hard links and
# it will execute that program.
#

set ARCH=`arch`

set script=$0		# Full path to this script.
set dir=$script:h	# directory containing this script
set progname=$script:t	# program to be executed (same name as this script).

if ( "$ARCH" == "sun3") then
	if ( ! `head -1 /etc/motd | fgrep -c 'Release 4.'` ) then
	    set ARCH="sun2"	        # Cheap trick to get the error below.
	endif
endif
if ( "$ARCH" == "sun2") then
	echo "You must be running 4.0 to run $progname."
	exit
endif

set prog=$dir/bin.$ARCH/$progname	# The real program!

if ( -f $prog ) then
        exec $prog -c $*
else
	echo "$0 - can't find $progname for your machine type: $ARCH."
        echo "$prog not found".
endif
