[K12OSN] Re: Need script help for fl_teachertool

Robert Arkiletian robark at gmail.com
Wed May 3 20:25:44 UTC 2006


On 5/2/06, Eric Harrison <eharrison at mail.mesd.k12.or.us> wrote:
> On Tue, 2 May 2006, Robert Arkiletian wrote:
>
> > On 5/2/06, Eric Harrison <eharrison at mail.mesd.k12.or.us> wrote:
> >> This should work better for you:
> >>
> >>         getent hosts | grep ^`echo $DISPLAY | sed -e 's/:/ /g'\   | awk
> >> '{print $1}'` | cut -f1
> >

Well this didn't work either. Not sure what the ^ is for but the
problem has been solved a different way. I just used

echo $DISPLAY

with this I get

wsXXX.ltsp:0.0
on a terminal

or
:0.0
on the server

then I just use C++ to throw away anything after the :
So I either have the wsXXX.ltsp or nothing. However, (and this was the
problem before) you can't grep for nothing. So if it's nothing I
replace it with "xxxxxxxxxxxxxxxxxx" which will never match anything
in /etc/hosts (as I want).
Then I used
getent hosts | grep -w line | awk '{print $1}'
where line is either xxxxxxxxxxxxxx or wsXXX.ltsp. So it works perfect now.

Expect Fl_TT 0.31 VERY soon with much improved speed :)
--
Robert Arkiletian
Fl_TeacherTool http://fltk.org/links.php?V269
C++ GUI tutorial http://fltk.org/links.php?V19




More information about the K12OSN mailing list