cp template $1_h.sql
ed $1_h.sql <<EOF
g/TABLE/s//$1/g
w
q
EOF
psql apple <$1_h.sql
