Re: How to get variable out to shell script

From: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
To: Alex Gadea <alex(dot)gadea(at)apptik(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to get variable out to shell script
Date: 2009-09-20 22:10:43
Message-ID: 1253484643.880.42.camel@hp-laptop2.gunduz.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-09-20 22:21:05 Re: How to get variable out to shell script
Previous Message Scott Marlowe 2009-09-20 22:10:10 Re: How to get variable out to shell script