[K12OSN] Re: Need script help for fl_teachertool

Robert Arkiletian robark at gmail.com
Wed May 3 01:44:15 UTC 2006


On 5/2/06, Robert Arkiletian <robark at gmail.com> wrote:
> I can find the ip of a client I am sitting at with
>
> cat /etc/hosts | grep `echo $DISPLAY | cut -d: -f1` | cut -f1
>
> problem is if I run this command from the server I get
>
> Usage: grep [OPTION]... PATTERN [FILE]...
> Try `grep --help' for more information.

Found a solution.

cat /etc/hosts | grep -w `echo $DISPLAY | sed -e 's/:/ /g' | awk
'{print $1}'` | cut -f1

which returns 127.0.0.1 and that works in my code.

I'm wondering are the client hostnames of

ws253.ltsp
ws252.ltsp
ws251.ltsp
etc...

always

192.168.0.253
192.168.0.252
192.168.0.251
etc...

if they always match like this then I don't need to look in /etc/hosts
--
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