该脚本为,如果满足i 等于mysql、information_schema、performance_schema、db_sys_stat 其中一个那么就跳出执行下面的。
重点介绍:
if 条件语句 [ ] 左右两个都要有一个空格。
#!/bin/bash
#2012-12-25 by coco
for i in `cat ./db_list.txt`
do
if [ "$i" == "mysql" ] || [ "$i" == "information_schema" ] || [ "$i" == "performance_schema" ] || [ "$i" == "db_sys_stat" ]; then
continue
else
echo '!!!!!!!!!!!!';
done