echo -e "The person you want to know does not exist! \nDo you want to try again or check out other's data? [y or n ,and any other key will exit! ]"
answer
else
echo -e "$showname"
echo Do you want to check another person\'s data? [y or n ,and any other key will exit! ]
answer
fi
fi
else echo -e "\33[31mThe addressbook isn't exist!\33[0m"; menu
fi
}
function deldata ()
{
showname
if [ -z "$showname" ]; then
echo -e "\33[31mThe person you want to delete does not exist! Please check the name first!:\33[0m"
menu
else
echo -e "The person 's data is :\n$showname"
echo -ne "\33[34m\tIs it right? \33[0m[ y or n ]: "
read
if [[ "$REPLY" == [Yy] ]]; then
awk -F: -v new=$name '{ if ( $1 != new ) print $0; }' addressbook > /tmp/tmp$$
mv -f /tmp/tmp$$ addressbook 2> /dev/null
if [ $? == 0 ]; then
本文关键:自己编的一个通讯录系统(简陋了点)