I'm having problems figuring out my login hostname under solaris 2.4.
My method works under sunos 4.1.x.
I'm have these general scripts that allow users to run the OpenLook
Window Manager on their PC X servers. Basically, I rexec into the
Sun and run the script. The script figures out my hostname using
the following...
set my_pc = `who am i | sed -e 's/.*(//' -e 's/\.*).*/:0.0/'`
or
set my_pc = `who | grep $USER | awk -F\( '{print $2}' | awk -F\) '{print $1}'`
and then I setenv $DISPLAY ${my_pc} or ${my_pc}:0.0
and then run olwm & and whatever else. My X servers are set to single window
mode, etc. I'm using csh, but I doubt that's the problem. As I said, this
works well under sunos 4.1.x (2,3,4c).
The problem is that when you rexec in under solaris 2.4, 'who' doesn't show
your hostname like it does under sunos 4.1.x. I don't have a hostname to
parse, so I get a NULL $DISPLAY variable and then olwm fails.
'man who' doesn't seem to give the info that I want, or I'm reading it badly.
I might be able to get something from netstat, but I'd like to avoid that at
all costs. :)
Am I going about this the wrong way? Does someone have something that works?
Is this related to the general utmp problems associated with solaris?
Thanks, Geoff
---
Geoff LeBoldus