RosettaCodeData/Task/Hostname/Phix/hostname.phix

7 lines
214 B
Plaintext

constant tmp = "hostname.txt",
cmd = iff(platform()=WINDOWS?"hostname":"uname -n")
{} = system_exec(sprintf("%s > %s",{cmd,tmp}),4)
string host = trim(get_text(tmp))
{} = delete_file("hostname.txt")
?host