#!/bin/bash
# ~/bin/cmot
tmot=md-`date +%Y%m%d`
if [ -f ~/compm ]; then
# mv ~/todaym ~/compm
if [ -f ~/`cat ~/compm` ]; then
motd > ~/todaym
diff -y ~/todaym ~/`cat ~/compm`
rm -i ~/`cat ~/compm`
rm ~/todaym
rm ~/compm
else
echo "file missing ~/'cat ~/compm'"
exit 1
fi
else
motd > ~/${tmot}
echo ${tmot} > ~/compm
echo "motd stored"
fi