#!/bin/bash
echo "
1,添加
2,删除
3,查询所有
4,单个查询
5,清空
6,恢复
7, 查询恢复
"
read -p "请选择:" choice
declare -A dic #定义字典
dic=([1]="add" [2]="delete" [3]="list" [4]="query" [5]="clean" [6]="recover" [7]="showrecover")
for key in $(echo ${!dic[*]}); do
if [ $choice -eq $key ]; then
echo ${dic[$key]}
exit
fi
done