Conclusion on one line
The following code works as expected. But I cannot format the output. It will print something like this:
mysql
test
someDB
I need the output on one line
mysql test someDB
I tried to use sed in the script, but it didn't work.
#!/bin/sh
for dbName in `mysqlshow -uroot -pPassWord | awk '{print $2}'`
do
echo "$dbName" | egrep -v 'Databases|information_schema';
done
+2
source to share
4 answers