Executing the command instead of printing

Tag: unix Author: yejb9999 Date: 2009-09-27

The following command "prints" the correct mysql commands. But I want to "execute" them :)

mysqlshow -uroot -pPassWord | awk '{print "mysqlshow -uroot -pPassWord --count", $2;}

mysqlshow -uroot -pPassWord --count world
mysqlshow -uroot -pPassWord --count zabbix

Best Answer

mysqlshow -uroot -pPassWord | awk '{print "mysqlshow -uroot -pPassWord --count", $2;} | sh

comments:

Thanks. I tried -exec and xargs