? , , [ ${array[key]+abc} ].
If so, the command completes successfully, so the command is executed after &&( echo "exists")
You want to check if it exists. Thus, you want your command to be executed if the part [..]fails. So use ||instead &&:
[ ${myhash[$key]+abc} ] || echo "does not exist"
&&: continue with the next command only if the first is successful
||: execute only the following command, if at first it was not possible to execute
Vuade source
share