|
Compare array values
# tail myprocesses.txt
178 processes at Tue Oct 21 14:33:01 IST 2008
16 MySQL processes at Tue Oct 21 14:33:01 IST 2008
175 processes at Tue Oct 21 14:36:01 IST 2008
60 MySQL processes at Tue Oct 21 14:36:01 IST 2008
192 processes at Tue Oct 21 14:39:01 IST 2008
64 MySQL processes at Tue Oct 21 14:39:01 IST 2008
178 processes at Tue Oct 21 14:42:01 IST 2008
67 MySQL processes at Tue Oct 21 14:42:01 IST 2008
176 processes at Tue Oct 21 14:45:01 IST 2008
68 MySQL processes at Tue Oct 21 14:45:01 IST 2008
# tail myprocesses.txt | grep -i 'mysql processes' | awk '{print $1}'
16
60
64
67
68
I want to compare the above values and if all of them are more than 50 then echo "Problem". In the above mentioned case, it will not echo "Problem" because first value i.e. 16 is less than 50
|