How to get host name in Linux in Adobe AIR NativeProcess?
I am creating Adobe AIR Application (for Windows, Linux and MAC), which show machine's Internal IP, External IP and Host Name. I've done successfully on Windows. I got host name on Windows by opening the c:\windows\system32\hostname.exe application using the Native for process.
But I don't know that such type of hostname application file exis开发者_C百科ts in Linux or not? If it really exists, then what is its path? How to get host name in Linux through opening any executable file or through any bash command?
Thanks in advance.
The best idea is to use
'$ uname -n'
after using
'$ uname --help'
P.S.: and yes,
$ which uname
/bin/uname
The hostname
command appears in must Unixes.
Here's the path from a Mac (you mention this as one of your target platforms and I don't have a Linux host up at the moment):
% type hostname
hostname is /bin/hostname
You shouldn't need to hard-code the path, though... hostname
is usually within your ${PATH}
environment variable (Q.E.D.). The same should be true for Windows.
Type in terminal:
hostname
You will get the hostname.
精彩评论