Dear all,

Below is the script to check the availability of file and unavailability it triggered mail for every team member it output is like that below:



heading is
= Status Terra files availability on Central Folder

All the Terra files from APO, BW and R/3 of 03/07/2013 are available in Central Folder HLL67...
Current Open orders extracts will be available by 10:27 PM.
No.of Terra files Available= 26



so above is it possible if i want this file availability in heading? :-

like that = Status Terra files availability on Central Folder number of file is ( ).

can i do like this =: - in script to get heading with number of files

"Status Terra files availability on Central Folder number of file is" $count (can it works . to show the number of files in heading.)


CURR_FDATE=`date -u +"%Y%m%d"`
CURR_DATE=`date -u +"%d"`
CURR_MONTH=`date -u +"%m"`
CURR_YEAR=`date -u +"%Y"`
COUNT=`ls -ltr /data/terra/outbound/*$CURR_FDATE* | wc -l`
echo $COUNT
if [ $COUNT -ge 26 ]; then
echo "\nAll the Terra files from APO, BW and R/3 of $CURR_DATE/$CURR_MONTH/$CURR_YEAR are available in Central Folder HLLP67...\n Current Open orders extracts will be available by 10:27 PM. \nNo.of Terra files Available= $COUNT\n\nRegards\nSrikanth\nHUL-Terra Implementation" >/data/terra/mail_message.txt
mail -s "Status Terra files availability on Central Folder" -c "email address" "email address" "email address" email address</data/terra/mail_message.txt
else
echo "\nAll the Terra files of $CURR_DATE/$CURR_MONTH/$CURR_YEAR are not available in Central Folder HLLSAP67..\nNo.of Terra files Available= $COUNT\n Please Open the Unix box HLL67 and check the missing extracts. You can raise a request to SAP-BASIS via Solman to transfer the required files, if not available by 19:30 today.\nRequired no. of files= 26 \n\nRegards\nSrikanth\nHUL-Terra Implementation" >/data/terra/mail_message.txt
mail -s "Attention !! Status Terra files availability on Central Folder" -c"email addres" "email address" "email address" </data/terra/mail_message.txt

fi