In bash
echo ${!X*}
will print all the names of the variables whose name starts with \'X\'. Is it possible to get the same with an ar
Use the builtin command compgen:
compgen -A variable | grep X