The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: Mailx usage
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-28-2008
andryk's Avatar
andryk andryk is offline Forum Advisor  
Registered User
  
 

Join Date: Sep 2003
Posts: 448
Hi,
You could insert the 'headers' between each cat
Code:
echo "Server A Logs for the day" >> logfile
echo "=========================" >> logfile
cat logfile1 >> logfile
echo "Server B Logs for the day" >> logfile
echo "=========================" >> logfile
cat logfile2 >> logfile
...
cat logfile3 >> logfile

cat logfile | mailx -s 'Server logs for the day' xxx@xxx.com