Re: Output shell variable from psql

From: Wim Bertels <wim(dot)bertels(at)ucll(dot)be>
To: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>, "mnunna(at)fnal(dot)gov" <mnunna(at)fnal(dot)gov>
Subject: Re: Output shell variable from psql
Date: 2024-04-08 15:30:07
Message-ID: 2d780c962fe0bf751857c68358e1db74ddae29c3.camel@ucll.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Murthy Nunna schreef op ma 08-04-2024 om 15:17 [+0000]:
> U ontvangt niet vaak e-mail van mnunna(at)fnal(dot)gov(dot) Meer informatie over
> waarom dit belangrijk is
>
> 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}

$ export test=E
$ psql
psql (16.2 (Debian 16.2-1.pgdg120+2))
Type "help" for help.

wim=# \! echo $test
E
wim=#

hth,
Wim

>  
> Thanks!
>  
>  

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Murthy Nunna 2024-04-08 15:45:06 RE: Output shell variable from psql
Previous Message jaya kumar 2024-04-08 15:23:52 Re: Autovacuum------Doubts