[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to detect which user is connected to $DISPLAY

Michelle Konzack wrote:
> I asume your are using TESTING or UNSTABLE...
> Under STABLE I get only something like
> joss     pts/0        Mar 26 14:42
> joss     pts/1        Mar 26 14:42
> toto     pts/2        Mar 26 15:06
> This is, why I have asked...
> The test I must do, should work under WOODY and higher Releases.

FWIW: That's not always the case.  Below is a real-world example
from a woody system with XDM:

koulutie!joey(pts/4):~> w
 19:28:13 up 29 days,  8:52,  6 users,  load average: 0.02, 0.04, 0.06
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
joey     tty2     -                09Mar05  9days  1:15   1:14   ssh finlandia
joey     :0       -                06Mar05 ?xdm?   0.00s   ?     -
joey     pts/0    :0.0             06Mar05 29days  0.26s  0.26s  bash
joey     pts/2    :0:S.0           06Mar05  3days  6:13   6:13   ssh finlandia
joey     pts/3    :0:S.1           06Mar05 29days 32:05m 32:05m  ssh finlandia
joey     pts/4    finlandia.home.i 07Mar05  1.00s  5.44s  0.18s  w
koulutie!joey(pts/4):~> w | awk '{print $1" "$2}' | grep ":0$" | awk '{print $1}'

So Sean's script works fine as it should be.

It doesn't, if X is started via startx, though.



Ten years and still binary compatible.  -- XFree86

Reply to: