Re: query shell environment or hardstatus in other windows

Aaron Davies <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <CACQi4XCYRHaxJCtCwfOhP9_LeokTAPJFa9PC6LuTdJc089zjNg@mail.gmail.com>
On Thursday, August 18, 2011, Kevin Van Workum <[email protected]>
wrote:
>
>
> On Thu, Aug 18, 2011 at 2:54 PM, Jostein Berntsen <jbernts-gyXR7Lt7FVk/[email protected]>
wrote:
>>
>> On 18.08.11,12:51, Kevin Van Workum wrote:
>> > On Thu, Aug 18, 2011 at 12:33 PM, Jostein Berntsen <
jbernts-gyXR7Lt7FVk/[email protected]>wrote:
>> >
>> > > On 18.08.11,10:36, Kevin Van Workum wrote:
>> > > > Hi,
>> > > >
>> > > > 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.
>> > > >
>> > >
>> > > This should work:
>> > >
>> > > :eval "at 0" "echo '$HOSTNAME $USER $PWD'"
>> > >
>> >
>> > No, that just evaluates the variables in screen's environment. I want
the
>> > variables in the operating shell of a given window, or just the status
line
>> > of a window.
>> >
>> >
>>
>> Would this work better?
>>
>> :eval "at 0" "exec echo '$HOSTNAME $USER $PWD'"
>
> No, that does basically the same thing. You can't really execute a command
like this to get the values I want. It will always just return the values in
screen's environment.

could you tell the other window to tell you its value via a nested "at"? not
sure of the syntax, conceptually it's, from 1, "at 0 \"at 1 stuff
\$HOSTNAME\""

-- 
Aaron Davies
[email protected]

_______________________________________________
screen-users mailing list
screen-users-mXXj517/[email protected]
https://lists.gnu.org/mailman/listinfo/screen-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.