#!/usr/bin/env bash str=$1 if [[ "$str" = "" ]]; then echo "1 empty" fi if [[ "$str" = " " ]]; then echo "2 empty" fi if [[ "$str" = "0" ]]; then echo "3 empty" fi if [[ "$str" = "00" ]]; then echo "4 empty" fi if [[ "$str" -eq 0 ]]; then echo "5 empty" fi if [[ "$str" -eq 000 ]]; then echo "6 empty" fi if [[ "$str" -eq '0' ]]; then echo "7 empty" fi if [[ "$str" -eq '00' ]]; then echo "8 empty" fi ## show results 1 empty 5 empty 6 empty 7 empty 8 empty