| 1234567891011121314151617181920212223242526 | #!/bin/sh## Script to create a table 'email' and to fill it with data.# The script accepts an optional argument : # A database to connect to. (default 'testdb')echo -n "Creating and filling table email in database ${1-testdb}..."psql ${1-testdb} << EOF >/dev/null 2>&1create table email ( id int4,name text,email text);insert into email values (1,'Michael Van Canneyt','[email protected]');insert into email values (2,'Florian Klaempfl','[email protected]');insert into email values (3,'Carl-Eric Codere','[email protected]');insert into email values (4,'Daniel Mantione','[email protected]');insert into email values (5,'Pierre Muller','[email protected]');insert into email values (6,'Jonas Maebe','[email protected]');insert into email values (7,'Peter Vreman','[email protected]');insert into email values (8,'Gerry Dubois','[email protected]');EOFif [ ! $? = 0 ]; then  echo "Failed."else  echo "Done."fi# Ready
 |