#!/bin/sh
#    latemail [n]
# Edit the last n files in the user's mail directory.

if [ $# -lt 1 ];then set 5;fi
N=$1
if [ -d $HOME/Mail ];then M=$HOME/Mail;else M=$HOME/M;fi
if [ ! -n "$EDITOR" ];then EDITOR=vi;fi

$EDITOR `ls -trd $M/* |tail -$N`
