#!/bin/bash
YESTERDAY=`TZ=GMT+48 date +%Y%m%d`
filename="import$YESTERDAY.log"
today=`date +%Y%m%d`
today="import$today.log"
value1=$(grep -i 'Invalid cells in file' "$filename" | cut -f2 -d':') // gives result 2458
value2=$(grep -i 'Invalid cells in file' "$today" | cut -f2 -d':') // gives result 1236
difference='$value1'-'$value2'
treshold=1000
if [[ $difference -gt $treshold ]]
then
I am tryng to subtract results of those grep's but it gives operator error which shown below
line 14: [[: $value1-$value2: syntax error: operand expected (error token is "$value1-$value2")