Hello this is my new script
phone book
you can add view and search
have nice day
phone book
you can add view and search
have nice day
#!/bin/bash # this is a beta version of bookofonia project #if you have any ideas or questions send it to me by mail #if there is any bug in this script plz tell me #gr8 to my brother Ahmed Yosef #bookphonia - Copyright (C) 2008 Ahmed Hassan <Dj.r[email protected]> #Under MIT licence menu() { echo "[1]Add contact" echo "[2]Search contacts" echo "[3]View the bookofonia" echo "[4]Exit" read answer if [ "$answer" = "1" ] ; then echo "What is the first name?" echo -n "Fristname=" read firstname echo "What is the last name?" echo -n "Lastname=" read lastname echo "What is the phone number?" echo -n "phone number=" read number echo "$firstname $lastname phone # $number" >> phonebook.db Sort menu elif [ "$answer" = "2" ] ; then echo "To search your bookofonia you must enter the first name of your contact" echo "What is the first name?" echo -n "first name=" read srchname cat phonebook.db |grep $srchname menu elif [ "$answer" = "3" ] ; then cat phonebook.db | more menu elif [ "$answer" = "4" ] ; then exit 0 else worng menu fi } worng() { echo "worng asnwer choose your number again" } Sort() { sort phonebook.db > phonebook.dbz rm phonebook.db mv phonebook.dbz phonebook.db } Sort # the script start from here xD menu #EOF
تعليق