: $Workfile:   unikix.sh  $ $Revision:   1.0  $
#**********************************************************************#
#*                                                                    *#
#* Copyright (c) 2001 by Sun Microsystems, Inc.                       *#
#* All rights reserved.                                               *#
#*                                                                    *#
#**********************************************************************#


# unikix
# call Sun MTP terminal processor, local or remote
# params: D:d:F:f:k:L:l:M:m:P:p:S:s:T:t:X:x:45ABCcJnUu

OPTIONS=""

while test "$1" != "--" && test "$1" != ""
do
    case $1 in
    -4)
	OPTIONS="$OPTIONS -4"
	;;
    -5)
	OPTIONS="$OPTIONS -5"
	;;
    -a|-A)
        if [ "$1" = "-a" ]
        then
	   OPTIONS="$OPTIONS -a"
        else
	   OPTIONS="$OPTIONS -A"
        fi
	;;
    -B)
	OPTIONS="$OPTIONS -B"
	;;
    -C|-c)
        if [ "$1" = "-c" ]
        then
	   OPTIONS="$OPTIONS -c"
        else
	   OPTIONS="$OPTIONS -C"
        fi
	;;
    -J)
	OPTIONS="$OPTIONS -J"
	;;
    -n)
	OPTIONS="$OPTIONS -n"
	;;
    -U|-u)
	OPTIONS="$OPTIONS -u"
	;;
    -D|-d)
	shift
	OPTIONS="$OPTIONS -D $1"
	;;
    -F|-f)
	shift
	OPTIONS="$OPTIONS -f $1"
	;;
    -k)
	shift
	OPTIONS="$OPTIONS -k $1"
	;;
    -l|-L)
        if [ "$1" = "-l" ]
        then
	   shift
	   OPTIONS="$OPTIONS -l $1"
        else
	   shift
	   OPTIONS="$OPTIONS -L $1"
        fi
	;;
    -M|-m)
	shift
	OPTIONS="$OPTIONS -m $1"
	;;
    -P|-p)
	shift
	OPTIONS="$OPTIONS -p $1"
	;;
    -S|-s)
	shift
	OPTIONS="$OPTIONS -s $1"
	;;
    -T|-t)
        if [ "$1" = "-t" ]
        then
	   shift
	   OPTIONS="$OPTIONS -t $1"
        else
	   shift
	   OPTIONS="$OPTIONS -T $1"
        fi
	;;
    -X|-x)
	shift
	OPTIONS="$OPTIONS -x $1"
	;;
    *)
	echo unikix encountered an illegal option: $1
	exit 1
	# illegal option encountered
	;;
    esac
    shift
done

$UNIKIX/bin/unikixl $OPTIONS

# If Sun MTP terminal handler terminates with an error,
# do not exit program until user presses a key. This
# gives time to the user for reading the error message
# before the window goes away.

if test $? -eq 1
then
    echo "Press RETURN to exit window"
    read dummy
fi
exit
