Anonymous user
Execute a system command: Difference between revisions
→{{header|Icon}}: Icon+Unicon header simplification
(brlcad) |
(→{{header|Icon}}: Icon+Unicon header simplification) |
||
Line 231:
SYSTEM(CoMmand='dir & pause') </lang>
=={{header|Icon}} and {{header|Unicon}}==
The code below selects the 'ls' or 'dir' command at runtime based on the UNIX feature.
<lang Icon>procedure main()
write("Trying command ",cmd := if &features == "UNIX" then "ls" else "dir")
system(cmd)
end</lang>
Unicon extends system to allow specification of files and a wait/nowait parameter as in the examples below.
<lang Icon>
pid := system(command_string,&input,&output,&errout,"wait")
pid := system(command_string,&input,&output,&errout,"nowait")
</lang>
=={{header|IDL}}==
<lang idl>$ls</lang>
|