Phone Shell Script !?

could you please find a solution for this

script (called phone) that creates a simple telephone list (create an empty file called �phonlist� in home directory) . Each line in this file consist of two fields name and the phone number, the script should do the following:
When user types the command : �phone new <name> <number>� this will add new record (name,number) to the list.
When user type command: �phone <name>� then the script should search in the file �phonelist� and gets the phone number and display the result.

Just a principle:

#! /bin/sh

if [ "$#" -eq 0 ]
then
        exit 1;
fi

if [ "${1}" = "new" ]
then
        echo "${2} ${3}" >> file

else
        cat file | grep "${1}";
fi



exit 0