The following is working as expected.
for schema in `mysql -e"show databases"`
do
if [[ $schema = 'test' ]];then
echo $schema
fi
done
But when I need to select all values starting with test, the following does not work for obvious reasons…
if [[ $schema = 'test%' ]];then
I want to select the other values like test_db, test123 etc.
You could use bash regexes: