On Wed, Dec 16, 2020 at 09:15:09AM -0800, Neal Fultz wrote: > 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')
Thanks, this is even closer. z is being set, but it outputs something to the screen which does go away after a few seconds. Any idea how to stop it from doing that? I wonder if there's some code I could output that turned off display output, did this command, then turn it back on again? I couldn't use this in an alias as it would disrupt the screen each time I ran ssh or scp. But it does get the necessary info. Thomas, what you suggest, it's similar to the people who suggest symlinking some known place to the /tmp folder and then setting that in the environment. Here's a link to the superuser.com post about this: https://superuser.com/questions/180148/how-do-you-get-screen-to-automatically-connect-to-the-current-ssh-agent-when-re You're right, it works a most of the time. Where it fails is if I log in a second time from a different computer. I was just looking to see if I could fix that. Michael
signature.asc
Description: PGP signature