PG=kinstall
H='
==========
kinstall [files]
==========
moves the specified files from their current directory to
the designated directory (default $PUBKIN).  A dummy file
is left behind to keep make happy.  This file has zero 
length at permission 600.  Previous files are saved with
the suffix .tmp.  Files have the symbol table removed before
transfer.
==========
        If not file list is given, kinstall generates one using
        find.
==========
'
while   :
do
case $1 in
        -h)             clear;echo "$H";exit 0;;
        -v)             set -v;;
        -x)             set -x;;
        -*)             clear;echo "$H";exit 0;;
        *)              LIST="$LIST $1";;
esac
case $# in
        0|1)    break;;
        *)      shift;;
esac
done
case $LIST in
    ""|" ") LIST=`find  $EHK -type f \
				-name '*.x' -size +1 ! -perm 644 -print`;;
    *)      XLIST=`find $LIST -type f -name '*.x' \
				-size +1 ! -perm 644 -print`;
            LIST=$XLIST;;
esac
case $LIST in
        "") echo "<no new files>";exit 0;;
        *)  ;;
esac
for i in $LIST
do
MOVR=$i
BASE=`basename $MOVR .x`
SAVE=$PUBKIN/$BASE.tmp
NEWX=$PUBKIN/$BASE.x
C='
echo "MOVR = $MOVR"
echo "SAVE = $SAVE"
echo "NEWX = $NEWX"
'
:
if test ! -s $MOVR
then
echo "<not a moveable file> $MOVR"
continue
fi
:
rm -f $SAVE
:
if test -s $NEWX
then
chmod 755 $NEWX
mv $NEWX $SAVE
echo "$NEWX -> $SAVE"
fi
:
strip $MOVR
mv $MOVR $NEWX
echo "$MOVR -> $NEWX"
:
> $MOVR
:
chmod 600 $MOVR
chmod 555 $NEWX
:
rm -f gdm*
done
