I am running the below script which throws me an errors with unary operator issue. In the main shell script program, I will be using this existing_sum_check variable down the line but I want to perform this check anyhow. How can I avoid this error?
Program:
#!/bin/sh
latest_sum_check=10101;
if [ $latest_sum_check != $EXISTING_SUM_CHECK ]; then
EXISTING_SUM_CHECK = $latest_sum_check;
echo $EXISTING_SUM_CHECK;
echo "Please process";
else
echo "Do not process"
fi
EXISTING_SUM_CHECK = $latest_sum_check
– Jeff Schaller Nov 28 '17 at 17:15