Re: How to get variable out to shell script - Mailing list pgsql-general

From Devrim GÜNDÜZ
Subject Re: How to get variable out to shell script
Date
Msg-id 1253484643.880.42.camel@hp-laptop2.gunduz.org
Whole thread Raw
In response to How to get variable out to shell script  (Alex Gadea <alex.gadea@apptik.com>)
List pgsql-general
On Sun, 2009-09-20 at 16:49 -0500, Alex Gadea wrote:
> I am using psql to call an external sql file that executes a simple
> select count(*):
>
> ie: select into ct count(*) from table;
>
> I can't figure out how to make the ct variable available to the shell
> script once the external sql file completes execution.

Try

psql -At -c "SELECT ..."

--
Devrim GÜNDÜZ, RHCE
Command Prompt - http://www.CommandPrompt.com
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                   http://www.gunduz.org

Attachment

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: How to get variable out to shell script
Next
From: Sam Mason
Date:
Subject: Re: How to get variable out to shell script