Code:
#!/bin/bash
NUMS=( $(grep -o "[0-9]\+" temp.log) )
if [ "${NUMS[(( ${#NUMS[@]} -2 ))]}" != "${NUMS[(( ${#NUMS[@]} -1 ))]}" ];then
echo "They are different"
else
echo "They are the same"
fi
The first line puts all numbers in the NUMS array.
The test checks the last 2 numbers to determine if they are the same.
NOTE: This (( ${#NUMS[@]} -2 )) means Number of elements in array NUMS - 2.
Remember array elements start a 0 so the last array element is actually (Number of elements in array - 1.)