第一版:
#!/bin/bash USER="root" DATABASE="test" TABLE="user" mysql -u $USER $DATABASE --html --default-character-set=utf8 < one.sql > /tmp/check.html mysql -u $USER $DATABASE --html --default-character-set=utf8 < two.sql >> /tmp/check.html
第二版:
#!/bin/bash USER="root" DATABASE="test" TABLE="user" #:>/tmp/check.html for i in one.sql two.sql three.sql; do mysql -u $USER $DATABASE --html --default-character-set=utf8 < $i >> /tmp/check.html done
第三版:
#!/bin/bash USER="root" DATABASE="test" TABLE="user" for i in `ls *.sql`; do mysql -u $USER $DATABASE --html --default-character-set=utf8 < $i >> /tmp/check.html done
http://bbs.chinaunix.net/thread-4166340-1-1.html
时间: 2024-10-24 22:04:23