examples of psql in shell script

From: Pam Wampler <Pam_Wampler(at)taylorwhite(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: examples of psql in shell script
Date: 2002-02-18 22:18:47
Message-ID: 2E4528861499D41199D200A0C9B15BC0012F45C5@taylorwhite.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I am trying to run a shell script & pass variables from the shell script to
psql & get the following error --
does anyone have examples (I have read through the documentation & can't
seem to get it right) thanks

this is my script cp.sh
#!/bin/sh
echo $1;
table1=$1;
echo $table1;
psql -c '\copy $table1 from 'fileout'' test

this is what i get when I run sh -x./cp.sh employees

ERROR: Relation ':table1' does not exist
\copy: ERROR: Relation ':table1' does not exist

Browse pgsql-novice by date

  From Date Subject
Next Message John Herreshoff 2002-02-19 00:39:38 Re: pg_dump - groups and users.
Previous Message knut.suebert 2002-02-18 21:23:42 Re: what does opaque mean in create function?