The following script allows one to type the command "./getama", which searches a logfile for text "REPT:AMATAPE SESSION", writes it to a file, then emails that file. I would like to modify it to where instead of typing "./getama" for today's date, you could type "./getama [any date]". Thanks.
HOME=/home/ao1dpenn
DATE=`date +%y%m%d`
FILE="${HOME}/ama.$DATE}"
ROP="/omp/omp-data/logs/rm/"
ROPFILE="${ROP}${DATE}.APX"
OF=$HOME/temp
echo "OUTPUT NOW BEING PRINTED\n"
/omp/bin/cgrep -R 'REPT;AMATAPE SESSION' ${ROPFILE} > ${FILE}
echo "OUTPUT NOW BEING WRITTEN TO ${FILE}\n"
cat ${FILE} | mail
someone@somewhere.com
rm ${FILE}