Create group in phonebook...

Use and complete the template provided. If you don't, your post may be deleted!

  1. The problem statement, all variables and given/known data:
    Hi, I am creating the phonebook shell script to store the name, number and address of the people. I am stuck in one point.I have done to add new user, list user and delete the user. But i don't know how to edit. My file in store in the file phonebook.txt. It is in the format title:name:phone1:phone2:address1:address2:groups. I need to edit the particular entry of that file. How can i do that? is there particular command. please help. Thanks in advance..

  2. Relevant commands, code, scripts, algorithms:

echo ""
echo "MENU"
echo "
"

    echo "1. Add new entries"
    echo "2. Show all entries"
    echo "3. Search for entries"
    echo "4. Edit existing entries"
    echo "5. Delete existing entries"
    echo "6. Exit"
    echo "Please enter your choice:"
    read choice
    case $choice in
      1\) addrecord;;
      2\) showall;;
      3\) searchrecord;;
      4\) delete;;
      5\) edit
    esac
  1. The attempts at a solution (include all code and scripts):

  2. School (University) and Course Number:
    JCU

Ok Here are some hint commands that I know could help you with :

1) addrecord;;
read name
read title
... etc etc
date="$name:$title ...."
cat $data >> /path/to/phonebook

2) showall;;
cat /path/to/phonebook

3) searchrecord;;
read tosearch
grep $tosearch /path/to/phonebook

4) delete;;
read tosearch
grep -v $tosearch /path/to/phonebook > /path/to/phonebook.tmp
cat /path/to/phonebook.tmp > /path/to/phonebook

5) edit
I dont know what does this mean

I guess you got the idea ...

Perhaps if you showed us what you done so far (code) we could understand you issue and give you some advice/help