Re: query shell environment or hardstatus in other windows

I would like to query the values of environment variable that are set in the shells of other window in my screen session. For example, I would like to know the value of $HOSTNAME in window 0 while in window 1.

Really, all I want is HOSTNAME, USER, and PWD which are all displayed on my hardstatus line. So if I could just get the hardstatus line for each window, that would be fine. The idea would be to create a screen-aware scp command to copy files from one location to another.

Kevin

I came up with a reasonably useful solution if you're interested. This solution allows you to 'stuff' the title of a window into the current window. If you set your window titles to "address@hidden:$PWD", then you can use this 'stuff' technique to scp files from one window to another. Here's how it works.

First, you need to setup your bash PROMPT_COMMAND to automatically set the window title. You can do this by adding the following to your bashrc. You need to add it to all the bashrc files on all your hosts that you use.