Help!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help!
# 1  
Old 07-03-2008
Help!

I need help on the following. I have a command which will read a file that came in today:

cnt_members=`wc -l ${DATA_DIR}/${RUNREF}_$MEMBERS_FILENAME | nawk '{ printf "%d\n", $0}'`

This gives me the member count of a file i.e. 10000. What i want to do is to set this with the count 10000 and when my script runs the next day it reads in the current refreshed file i.e. 8000.

Further on the script i do an if statement that says if the count from today is less than yesterday then status is warning!!!

basically i want to compare the two figures from both days files

maybe the command is not correct fro this but i'm not sure.

any help would be greatly appreciated
# 2  
Old 07-03-2008
Quote:
Originally Posted by Pablo_beezo
basically i want to compare the two figures from both days files
I'm assuming you won't have both files available at the same time, so you'll need some sort of history.
Perhaps just write it out to a file. When your script starts, read in the value in the file (that's from yesterday), do your calculation, generate any warnings you need, then write out today's value to the file before you quit.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question