In Bash I have following code:
alterCmd=alter table $tablename modify $columnname $columntype not null\; | mysql -ulogin -ppw -A $databasename
Normally I do:
echo alter table $tablename modify $columnname $columntype not null\; | mysql -ulogin -ppw -A $databasename
and it works. But I have to build up alterCmd and run it at the end.
How can I run the command that is stored in alterCmd?