自己编的一个通讯录系统(简陋了点)[7]

[入库:2005年9月19日] [更新:2007年3月24日]

本文简介:

                addperson
}

 chauney 回复于:2005-03-18 21:04:48 show脚本,用来查询的:
function answer ()
{
                read
                case $REPLY in
                        y|Y|[Yy][Ee][Ss] ) show ;;
                        n|N|[Nn][Oo] ) menu ;;
                        * ) exit 0;;
                esac
}
 
function showname ()
{
        showname=`awk -F: -v new=$name '{ if ( $1 == new ) print $0; }' addressbook | awk -F: '{ printf "%-10s%s\n%-10s%s\n%-10s%s\n%-10s%s\n%-10s%s\n%-10s%s\n\n", "Name: ", $1, "E-mail: ",$2,  "Address: ", $3,  "Phone Number: ", $4,  "Moblie Phone Number: ", $5, "Other Messages: ", $6 ; }' `
}
 
function showall ()
{
        awk -F: '{ printf "%-10s%s\n%-10s%s\n%-10s%s\n%-10s%s\n%-10s%s\n%-10s%s\n\n", "Name: ", $1, "E-mail: ",$2,  "Address: ", $3,  "Phone Number: ", $4,  "Moblie Phone Number: ", $5, "Other Messages: ", $6 ; }' addressbook
}
 
function show ()
{
        echo -ne "\33[33mWhose data  you want to know ?  \n\33[34mType his or her name directly ( Type "all" for check out for all people! ):  \33[0m"
        read name
        if [ -f "addressbook" ]
                then
                        if [ $name == "all" ]
                                then
                                        showall
                                        echo -e "\33[33mType "y" to check a person's data, and "n" to the main menu, other keys will exit!\33[0m"
                                        answer
                        else
                                        showname
                                        if [ -z "$showname" ]; then

本文关键:自己编的一个通讯录系统(简陋了点)
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top