<br><tt><font size=2>freenx-knx-bounces@kde.org wrote on 28/11/2011 22:03:04:<br>
<br>
> Just another note on your patch:<br>
> <br>
> I noticed the following line which is supposed to retrieve the IP<br>
> address of a given hostname:<br>
> <br>
> XDM_HOST_ADDRESS=$(dig +short +search $XDM_HOST|egrep<br>
> "^([0-9]{1,3}[.]){3}[0-9]{1,3}$"|tr "\n" "
"|cut -d " " -f1)<br>
> <br>
> I'd suggest to use the following perl 1-liner instead:<br>
> <br>
> XDM_HOST_ADDRESS=<br>
> $(perl -e 'use Socket;@a=gethostbyname shift;print inet_ntoa @a[4];'<br>
> $XDM_HOST)<br>
> <br>
> Advantage: It also resolves names from /etc/hosts (dig, nslookup and<br>
> host all use DNS only). Furthermore, dig, nslookup or host might not
be<br>
> available on any system while perl - at least the core - certainly
is.<br>
> (e.g: On my Fedora, dig belongs to the bind-utils package)</font></tt>
<br>
<br><tt><font size=2>Oh yes, you're right !!</font></tt>
<br>
<br><tt><font size=2>Resolving using "gethostbyname" is of course
how nxagent behaves.</font></tt>
<br>
<br><tt><font size=2>I forget about this because I never use /etc/hosts</font></tt>
<br>
<br><tt><font size=2>I'll send an update . . .</font></tt>
<br>
<br><tt><font size=2>> <br>
> Cheers<br>
>  -Fritz<br>
> <br>
</font></tt>