examples of psql in shell script - Mailing list pgsql-novice

From Pam Wampler
Subject examples of psql in shell script
Date
Msg-id 2E4528861499D41199D200A0C9B15BC0012F45C5@taylorwhite.com
Whole thread Raw
List 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

pgsql-novice by date:

Previous
From: knut.suebert@web.de
Date:
Subject: Re: what does opaque mean in create function?
Next
From: John Herreshoff
Date:
Subject: Re: pg_dump - groups and users.