Hello Guys,

I am trying to write a script, which will check is there a new email or not.

Code:
#!/usr/bin/sh

        while true
        do
                mail -E
                #stat=`echo $status`
                echo $status
                if [  echo "$status" -eq 0 ]
                then
                        echo There is new e-Mail to read.
                        exit 1
                else
                        echo No new e-Mail.
                        sleep 30
                        continue
                fi
        done
It is directly printing "There is new e-Mail to read." and terminating program eventhough there is no email.

Is anyone can help me?