Get system command output: Difference between revisions
Content added Content deleted
m (→{{header|R}}) |
|||
Line 776: | Line 776: | ||
<pre>Find_URI_in_text.p6 History_variables.p6 K-d_tree.pl |
<pre>Find_URI_in_text.p6 History_variables.p6 K-d_tree.pl |
||
Fractran.pl History_variables.pl XML_Input.p6</pre> |
Fractran.pl History_variables.pl XML_Input.p6</pre> |
||
=={{header|Phix}}== |
|||
<lang Phix>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</lang> |
|||
{{out}} |
|||
<pre> |
|||
"Pete-PC" |
|||
</pre> |
|||
See also demo\capture_console.exw (needs a bit more work on linux) |
|||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |