Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function resetdb()
- {
- host="asdf"
- user="asdf"
- passwd="asdf"
- database=( "asdf" "asdf")
- for db in "${database[@]}"; do
- read -r -d '' -a tables < <(mysql -u$user -p$passwd -h$host $db -B -s -e 'show tables');
- (IFS=,; echo "DROP TABLE ${tables[*]};") | mysql -v -u$user -p$passwd -h$host $db;
- mysql -u$user -p$passwd -h$host $db < ../../../database/$db.sql;
- mysql -u$user -p$passwd -h$host $db < ../../../database/demo.sql;
- done
- }
- ./update.sh: line 35: syntax error near unexpected token `;'
- ./update.sh: line 35: ` (IFS=,; echo "DROP TABLE ${tables[*]};") | mysql -v -u$user -p$passwd -h$host $db;'
- ./update.sh: line 36: ../../../database/.sql: No such file or directory
- mysql: option '-h' requires an argument
- ./update.sh: line 38: syntax error near unexpected token `done'
- ./update.sh: line 38: ` done'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement