使用bash脚本

时间:2017-05-22 13:40:00

标签: mysql bash

我想编写一个bash脚本,只有当该名称的数据库不存在时,才会从名称列表中创建一组mysql数据库。但是,我希望脚本生成由于已存在而未创建的所有数据库的列表。我该如何编写脚本来测试它?

我认为需要遵循的脚本大纲如下:

#!/bin/bash

mysql -h DATABASESERVER -u root -pPASSWORD <<EOF

input = $1
while IFS= read line
do
#test to see if database exists

#if exists
echo "$line" >> "$1_failures.txt"
#if does not exist

done < "$input"

0 个答案:

没有答案