var1="121212" var2="121212" if [ "$var1" = "$var2" ]; then echo "The same!" else echo "Different!" fi