If you don't mind, I'll give you some general pointers and code snippets from my own. You should be able to tweak them to your own needs, these is by no means a ready to run program!
If you want to do something with a number of files:
Code:
#turn off globbing
set -f
FCL=" -iname *.pdf -print -o -iname *.html -print "
dir="/tmp"
for file in $( find $dir -type f $FCL )
do
# compare size etc.
done
To compare the size of a file:
Code:
fsize_first=` ls- l fname | awk '{print $5}'`
fsize_now=` ls- l fname.1 | awk '{print $5}'`
if [ $fsize_first -eq $fsize_now ]
then
# file sizes are equal, do something
fi
To send myself an e-mail, I prefer sendEmail (or sendemail, not sure what the case is of the program name). Very simple and straightforward.
You also might want to peek in the
advance bash scripting guide if you haven't done also.
jlinkels