From: Murthy Nunna <mnunna@fnal.gov>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Output shell variable from psql
Date: Mon, 8 Apr 2024 15:17:45 +0000
Message-ID: <DM8PR09MB667723C1012EDD032EC1BE22B8002@DM8PR09MB6677.namprd09.prod.outlook.com> (raw)
Hi,
Is there a way to output shell variable from psql?
export TEST_V=7
echo Value is ${TEST_V}
Value is 7
psql -U postgres -p 5439
\echo Value is ${TEST_V}
Value is ${TEST_V}
Thanks!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: mnunna@fnal.gov
Subject: Re: Output shell variable from psql
In-Reply-To: <DM8PR09MB667723C1012EDD032EC1BE22B8002@DM8PR09MB6677.namprd09.prod.outlook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox