I have an array like: moduleList=(AB, ABCdef, ABCd)
moduleList=(AB, ABCdef, ABCd)
My array is numerically-indexed array not an associative array. I want to do an exact match for each element in array and to perform certain tasks.
Currently I'm doing like: if [[ ${moduleList["AB"]} ]]; then #do this. fi
if [[ ${moduleList["ABCdef"]} ]]; then #do that. fi
if [[ ${moduleList["AB"]} ]]; then
#do this.
fi
if [[ ${moduleList["ABCdef"]} ]]; then
#do that.
fi
But both the conditions are getting true as "AB""AB" is there in each word. How can I distinguish each condition based on an exact match.