Hostname: Difference between revisions
jq
(→{{header|AWK}}: warning) |
(jq) |
||
Line 369:
var hostname = network.computerName;
WScript.echo(hostname);</lang>
=={{header|jq}}==
Currently jq does not have a "gethostname" or a "system" command, so the best ways for a jq program to have access to the hostname are via an environment variable, or via a command line argument, as illustrated here:
<pre>HOST=$(hostname) jq -n --arg hostname $(hostname) '[env.HOST, $hostname]'</pre>
{{output}}
<pre>[
"mini.local",
"mini.local"
]</pre>
=={{header|Julia}}==
|