#!/bin/bash bye () { echo "run me as root!" exit 1 } [ $(id -g) -ne 0 ] && bye cat reset.sql q*.sql | mysql -u root mysql for file in t*.sql; do mysql -Hu root mysql < "$file" &> "${file/%.sql}.md" done m4 `basename $PWD`.m4 > `basename $PWD`.md