#!/bin/sh 
if [ "$1" = "" ]
then
	echo "Usage : $0 <value>"
	echo "where value is the sequence number of the note you want to remove"
	echo
	exit 0
fi

if [ $1 -le 0 ]
then
	echo "fool..."
	exit 0
fi

count=0
for i in $HOME/.mnote/note_*
do
        [ ! -f $i ] && continue 
	count=`expr $count + 1`
	if [ $count = $1 ]; then
		more $i
		exit 0
	fi
done

if [ $count = 0 ]
then
        echo "There are no notes."
else
	echo "Last note is $count. The value $1 is too high"
	
fi
