[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reading an environment variable from screen
From: |
Neal Fultz |
Subject: |
Re: reading an environment variable from screen |
Date: |
Wed, 16 Dec 2020 09:15:09 -0800 |
There is not a getenv command to match setenv iirc.
There's a -Q flag for query - z=$(screen -S $STY -Q echo '$SSH_AUTH_SOCK')
Getting the shell quoting correct will probably be pretty fiddly though.
On Wed, Dec 16, 2020 at 7:09 AM Michael Grant <mgrant@grant.org> wrote:
>
> When I reattach to screen, the SSH_AUTH_SOCK is wrong.
>
>
>
> I often ssh in and run screen simultaneously on a laptop and desktop. So I
> can’t use the trick of symlinking something to /tmp/ssh-xxxxxxxxxx.
>
>
>
> Is there some way to interrogate screen to tell me what the contents of an
> environment variable are?
>
>
>
> Running this in a shell inside of screen:
>
>
>
> screen -S $STY -X colon 'exec |echo $SSH_AUTH_SOCK\r'
>
>
>
> gives me the info I’m looking for, but it pushes it out to the display. I’m
> so close! How can I capture this output?
>
>
>
> My goal here is to create a sort of ssh/scp pre-command as a shell alias that
> probes screen each time and sets the SSH_AUTH_SOCK variable correctly.
- reading an environment variable from screen, Michael Grant, 2020/12/16
- Re: reading an environment variable from screen, Thomas Köhler, 2020/12/16
- Re: reading an environment variable from screen,
Neal Fultz <=
- Re: reading an environment variable from screen, Michael Grant, 2020/12/16
- Re: reading an environment variable from screen, Neal Fultz, 2020/12/16
- Re: reading an environment variable from screen, Thomas Köhler, 2020/12/17
- Re: reading an environment variable from screen [SOLVED], Michael Grant, 2020/12/17
- Re: reading an environment variable from screen [SOLVED], Michael Grant, 2020/12/17
- Re: reading an environment variable from screen [SOLVED], Michael Grant, 2020/12/17