scripting - write a script that will count the number of times a particular word

hello everyone,
I'm trying to learn some scripts but i cant get my head around two of them.

  1. how can i write a script that will count the number of times a particular word is used in file?

  2. how can i make a script that will take me to a web page from unix?

if anyone could help it would be appreciated very much.

What are you writing these scripts in? What shell?
(What OS too)

Post anything you may have started and the problems you are having.

Even i am very new to scripting so i am not very sure of some advance regular expressions. So i am giving the basic shell script

 
count=0
for i in  $(cat location of file)
do
if [ $i == name ]; #name which you want to find from the given file
then
count=`expr $count + 1`
fi
done
echo $count

Homework is not permitted at The UNIX and Linux Forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

Thank You.

The UNIX and Linux Forums.