09-12-2007
91,
0
Join Date: Aug 2007
Last Activity: 19 November 2008, 10:48 AM EST
Location: Binfield, Berkshire. UK
Posts: 91
Thanks Given: 0
Thanked 0 Times in 0 Posts
echoing dates in the mail
Your coded as posted (now=`date '+%m%d%y'`) will simply set the variable $now to be - EG - 091207.txt
It will *not* create a file called 091207.txt.
If all you want to do is include the contents of $now and $now2 in your email then you can do...
echo "${i}$now not found, %now; $now2; Please contact Production Support" |
mailx -s "Alert: File not Found" $alertUser
Please note that as your code stands $now and $now2 will only differ by the time it takes for the script to execute the first and then the second variable assignments. It almost certainly means they will always be set to the same value. This raises the question of why you need two variables rather than one as you say that you are looking for log files with the current (same?) timestamp.