【发布时间】:2015-08-25 07:07:35
【问题描述】:
我有一系列动物:
declare -A animals=()
animals+=([horse])
我想检查动物是否存在:
if [ -z "$animals[horse]"]; then
echo "horse exists";
fi
但这不起作用。
【问题讨论】:
-
您可能会在这组全面的答案中获得好运。 stackoverflow.com/questions/13219634/…
标签: bash