Ofcourse `env | grep "pattern"` would work if the variables are exported. But you will have
to run 2 commands in pipe and export the variable. Simpler and smarter way to do it? ! and *
for the rescue.
$>var1="asterix"
$>var2="obelix"
$>varIII="getafix"
$>varIV="julius"
$>varFiVe="caeser"
$>echo ${!var*}
var1 var2 varIII varIV varFiVe
Now time for some more magic. You can display the value of all these variables
using this prop
$>for eachVar in ${!var*}; do
echo ${!eachVar}
done