RE: Output shell variable from psql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks! That worked.

-----Original Message-----
From: Wim Bertels <wim.bertels@xxxxxxx> 
Sent: Monday, April 8, 2024 10:30 AM
To: pgsql-admin@xxxxxxxxxxxxxx; Murthy Nunna <mnunna@xxxxxxxx>
Subject: Re: Output shell variable from psql

[EXTERNAL] – This message is from an external sender

Murthy Nunna schreef op ma 08-04-2024 om 15:17 [+0000]:
> U ontvangt niet vaak e-mail van mnunna@xxxxxxxx. 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!
>
>





[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux