Version 4 of ambiguous result with "info hostname "

Updated 2010-04-08 10:49:03 by MaheshD

MaheshD: The issue is as below :

My machine :

Bash command : "hostname" returns - and ip-address is


Tclsh8.4 command : "info hostname" returns - localhost.localdomain and ip-address is

Expected is the same behavior as the bash euqivalent "hostname".

Why is this ambiguity ? Is it not reliable to use "info hostname" ? If yes (not reliable), what is the equivalent command (other than bash hostname) ?

Lars H: How to find my own ip address is probably relevant reading. But if you know you'll always want exactly what the shell hostname command returns, then you can of course do exec hostname. Also, TclX has a host_info command.

MaheshD - 2010-04-08 06:04:33

The problem is not with fetching the ip-address. I have a function, which does sufficiently well to return the correct ip-address. Problem is with the hostname.