#!/bin/bash

if [ "$#" -ne 1 ]
then
	echo "illegal number of parameters, must be 1 was $#"
	exit
fi

NEW="$(echo $1 | tr a-z A-Z)"
TYPE_FILE=".type"
if [ -f "$TYPE_FILE" ]
then
	OLD="$(cat $TYPE_FILE | tr a-z A-Z)"
	if [ $OLD == $NEW ]
	then
		echo > /dev/null
		# echo "$TYPE_FILE stayed unchanged"
	else
		echo "$NEW" > "$TYPE_FILE"
		# echo "$TYPE_FILE changed from '$OLD' to '$NEW'"
	fi
else
	echo "$NEW" > "$TYPE_FILE"
fi
echo "$TYPE_FILE"