I'd like to send variable in psql into shell to do some tricky things with it there and use the result in psql again. See:
\set ENVIR `echo :HOST | cut -f2 -d-`
\echo :ENVIR
However, the psql variable seems to be not interpolating in backticks as I would expect: shell's echo :HOST gives just :HOST. Help, please.