:: [DNG] ID which /dev/pts/? running j…
Top Page
Delete this message
Reply to this message
Author: Mike McClain
Date:  
To: dng
Subject: [DNG] ID which /dev/pts/? running just bash?
Howdy,
    Most of what I do on the computer is text so I keep several VTs
open, /dev/tty{1-10}, but now and then want to send some text to an open
xterm window on the desktop. Since I've never managed to get
copy/paste to work between a tty and an xterm window I have to go to X
and see what the xterm running bash thinks it is then go back to a tty
and '$ echo "something" > /dev/pts/X'.


    Though I normally have 1 xterm running just bash, one running mc
and firefox running, the pts running bash moves around.
One time when I launch X it's /dev/pts/0 the next time it may be pts/1
or pts/2. It is totally unpredictable even though I launch xterm, then
mc, then firefox in that order consistantly.


    At this moment "$ ps | grep 'pts.*bash'" shows bash running on
/dev/pts/{0,1,3,4}. "$ ps | grep 'pts.*mc'" shows mc on pts/2, Firefox
has many tasks running on pts/1 and by looking in X I can see that my
single xterm window today is on pts/0. I've no clue what is going on
on /dev/pts/{3,4} as ps doesn't tell me anything other than
'bash -rcfile .bashrc' for them both yet I have no other windows open
in X.


    Unfortunately '$ ps | grep xterm' shows '?' for the tty and
"'$ ps | grep 'pst.*xterm'" returns nada.


    If anyone can tell me how from a tty to know which pts is the open
xterm I'd be most grateful.


Thanks and Be Well,
Mike
--
I reserve the right to be completely wrong.