I am trying to automate a set of procedures that create TEMPLATE databases.
I have a set of files (file1, file2, ... fileN), each of which contains a set of pgsql com
you can echo your commands to the psql input:
echo
for dbname in foo foofoo foobar barbar do echo """ CREATE DATABASE $dbname TEMPLATE mytemplate1 """ | psql done