I have written this code in which m getting bad substitution error. Please help here.
#!/bin/bash
function detect_value(){
#some operation gives u a value
echo "ABCD"
}
ABCD_COUNT=26
echo "${"$(detect_value)"_COUNT}"
bash run.sh run.sh: line 12: ${"$(detect_value)"_COUNT}: bad substitution