Problem inside 'if'

Hi,

I am using a test inside an if loop like below
if [ \($current_min - $timestamp_min\) -le "2" -o \($current_min - $timestamp_min\) -le "2" ]
then
..........do something...

However, when I am running the script by sh -x <script_name>, I am getting an error like test.sh: test: unknown operator -.

Both the variables current_min and timestamp_min are numeric.

Many thanks

You can try this:

if [ `expr $current_min - $timestamp_min` -le 2 -o `expr $current_min - $timestamp_min` -le 2 ]
then
echo "testing"
fi