#!/bin/sh

# @(#)SERIAL version 3.7 created 1/14/93
# @(#)Copyright (c), 1987, 1992 StatSci, Inc.  All rights reserved.
# Print the serial number if it exists or change the serial number

SERIAL_FILE=$SHOME/SERIAL

case $# in
	0)	# Print out the serial number if its file exists
		if [ -f "$SHOME/SERIAL" ]
		then
			cat "$SHOME/SERIAL"
		else
			echo "Error no file: $SHOME/SERIAL"
			echo "Enter the following to add a serial number."
			echo
			echo "Splus SERIAL"
			exit 1
		fi;;
	1)	# Set a new serial number.
		echo "Please enter the serial number on your tape:"
		read SERIAL_NUM
		echo $SERIAL_NUM > $SERIAL_FILE
		echo "Set the serial number to: $SERIAL_NUM" ;;
	*)	echo "Usage: Splus SERIAL [set]"
esac
