Help - Polling Script

How do I write a shell script to perform polling just like what happens with Microsoft mail. i.e display an alert box.

It really depends what you're trying to poll
as to what specific scripting language to use
but once you have created the shell or perl
or awk or python or etc. script, you would
then execute that script via cron. You would
set up a cron job in some user's crontab to
run at specified intervals assuming you do
not have to poll faster than once every miniute.

For instance, to poll a web page, you might
want to use a perl script to run every 10min
or so. To just poll a TCP connection using ping,
you can just use a shell script. It really depends
on your needs and what scripting tool can give
you the best tool set for the job.