Friday, April 20, 2012

Bash script - execute all sql files in a directory


#!/bin/bash

for i in $(ls *.sql)
do

echo "Executing" $i;
mysql  -u root < $i

done