Hello Guys,
I am trying to write a script, which will check is there a new email or not.
It is directly printing "There is new e-Mail to read." and terminating program eventhough there is no email.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
Is anyone can help me?
![]()
your if[] condition isn't correctwould be a better way, altho it hasn't been tested.Code:#!/usr/bin/sh while true do if [ `mail -e` -eq 0 ] then echo There is new e-Mail to read. exit 1 else echo No new e-Mail. fi sleep 30 done
Don't worry Ma'am. We're university students, - We know what We're doing.
'Ruiat coelum, fiat voluntas tua.'Datalogi - en livsstil; Intet liv, ingen stil.
Bookmarks