I have a file that should cover a days worth of stats, at the beginning of each 15 minute report I have a unique header that looks like the below example. The "0000" and "0015" will change in the header line to show which 15 Minute interval the report is covering and of course from day to day the "A20130604" will change based on the date. My thinking in the script is there should be 96 headers for a complete day.
A20130604.0000-0600-0015-0600_SubNetwork=DMME1,ManagedElement=ces-1
I am trying to write I quick "if else then" script to let me know if I have all the reports. I have tried the following:
#!/bin/ksh
x='cat /home/fsan/output/samfile | grep DMME | wc -l'
y=96
if [ "$x" -le 95 ]
then
echo "You are missing files"
else
echo "All hourly files appear to be present"
fi
When I run the file I get:
samcheck[4]: cat /home/fsan/output/samfile | grep DMME | wc -l: bad number
I have also tried changing the
if [ "$x" -le 95 ]
line to
if [ "$x" < $y ]
Then I get:
samcheck[5]: 96: cannot open
Any help on what I am doing wrong would be amazing!! I also wouldn't mind help on making a more dynamic script that can maybe tell me which hours I am missing.