[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

scripting question



I have a simple script that counts up the number of spam messages each day and prints the total number into a text field.  This is fine as far as it goes, however I would like to also include the date and the number of non-spam messages.

 

I can get this to run, however each piece of information is printed on it’s own line.  I would like to have all of the results append in my text file on the same line so that I can easily import it into a spreadsheet or database.

 

How would I go about doing this? 

 

My script is as follows:
#!/bin/sh

TERM=vt100

export TERM

exec >> /root/countspam.txt

date && echo " Spam Count" && /bin/more /var/log/syslog | /bin/grep -c 'identified spam' && echo " " && echo "Clean Message Count " &&  /bin/more /var/log/syslog | /bin/grep -c 'clean message'


Reply to: