Execute a system command: Difference between revisions
Content added Content deleted
Drkameleon (talk | contribs) |
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
||
Line 243: | Line 243: | ||
=={{header|AppleScript}}== |
=={{header|AppleScript}}== |
||
<lang applescript>do shell script "ls" without altering line endings</lang> |
<lang applescript>do shell script "ls" without altering line endings</lang> |
||
=={{header|Applesoft BASIC}}== |
=={{header|Applesoft BASIC}}== |
||
<lang ApplesoftBASIC>? CHR$(4)"CATALOG"</lang> |
<lang ApplesoftBASIC>? CHR$(4)"CATALOG"</lang> |
||
Line 334: | Line 335: | ||
return 0; |
return 0; |
||
}</lang> |
}</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|C sharp|C#}}== |
=={{header|C sharp|C#}}== |
||
Line 365: | Line 362: | ||
} |
} |
||
}</lang> |
}</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Clojure}}== |
=={{header|Clojure}}== |
||
Line 471: | Line 473: | ||
=={{header|dc}}== |
=={{header|dc}}== |
||
<lang dc>! ls</lang> |
<lang dc>! ls</lang> |
||
=={{header|DCL}}== |
=={{header|DCL}}== |
||
<lang DCL>Directory</lang> |
<lang DCL>Directory</lang> |
||
Line 702: | Line 705: | ||
... |
... |
||
</pre> |
</pre> |
||
⚫ | |||
⚫ | |||
=={{header|Go}}== |
=={{header|Go}}== |
||
Line 720: | Line 727: | ||
} |
} |
||
}</lang> |
}</lang> |
||
⚫ | |||
⚫ | |||
=={{header|Groovy}}== |
=={{header|Groovy}}== |
||
Line 767: | Line 770: | ||
pid := system(command_string,&input,&output,&errout,"nowait") |
pid := system(command_string,&input,&output,&errout,"nowait") |
||
</lang> |
</lang> |
||
=={{header|IDL}}== |
=={{header|IDL}}== |
||
<lang idl>$ls</lang> |
<lang idl>$ls</lang> |
||
Line 1,023: | Line 1,027: | ||
> (io:format (os:cmd "ls -alrt")) |
> (io:format (os:cmd "ls -alrt")) |
||
</lang> |
</lang> |
||
=={{header|Liberty BASIC}}== |
=={{header|Liberty BASIC}}== |
||
Line 1,030: | Line 1,033: | ||
run "cmd.exe /";drive1$;" dir & pause" |
run "cmd.exe /";drive1$;" dir & pause" |
||
</lang> |
</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Limbo}}== |
=={{header|Limbo}}== |
||
Line 1,072: | Line 1,066: | ||
It's not strictly necessary to pass the graphics context to ls, but it is generally a good idea to do so when calling another program. |
It's not strictly necessary to pass the graphics context to ls, but it is generally a good idea to do so when calling another program. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Locomotive Basic}}== |
=={{header|Locomotive Basic}}== |
||
Line 1,206: | Line 1,209: | ||
M3toC.FreeCopiedS(command); |
M3toC.FreeCopiedS(command); |
||
END Exec.</lang> |
END Exec.</lang> |
||
=={{header|MUMPS}}== |
=={{header|MUMPS}}== |
||
<p>ANSI MUMPS doesn't allow access to the operating system except possibly through the View command and $View function, both of which are implementation specific. Intersystems' Caché does allow you to create processes with the $ZF function, and if the permissions for the Caché process allow it you can perform operating system commands.</p> |
<p>ANSI MUMPS doesn't allow access to the operating system except possibly through the View command and $View function, both of which are implementation specific. Intersystems' Caché does allow you to create processes with the $ZF function, and if the permissions for the Caché process allow it you can perform operating system commands.</p> |
||
Line 1,368: | Line 1,372: | ||
ExecuteProcess('/bin/ls', '-alh'); |
ExecuteProcess('/bin/ls', '-alh'); |
||
end.</lang> |
end.</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|PDP-11 Assembly}}== |
=={{header|PDP-11 Assembly}}== |
||
Line 1,457: | Line 1,438: | ||
... |
... |
||
.cmd_ls EQUS "ls",0</lang> |
.cmd_ls EQUS "ls",0</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
Line 1,520: | Line 1,516: | ||
{{works with|GNU Prolog}} |
{{works with|GNU Prolog}} |
||
<lang prolog>shell('ls').</lang> |
<lang prolog>shell('ls').</lang> |
||
=={{header|PureBasic}}== |
=={{header|PureBasic}}== |
||
<lang PureBasic>ImportC "msvcrt.lib" |
<lang PureBasic>ImportC "msvcrt.lib" |
||
Line 1,584: | Line 1,581: | ||
(system* (find-executable-path "/bin/ls") "-l") |
(system* (find-executable-path "/bin/ls") "-l") |
||
</lang> |
</lang> |
||
⚫ | |||
(formerly Perl 6) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Raven}}== |
=={{header|Raven}}== |
||
Line 1,715: | Line 1,721: | ||
<lang smalltalk>Smalltalk system: 'ls'.</lang> |
<lang smalltalk>Smalltalk system: 'ls'.</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|SQL PL}}== |
=={{header|SQL PL}}== |
||
Line 1,745: | Line 1,746: | ||
!dir |
!dir |
||
</lang> |
</lang> |
||
⚫ | |||
⚫ | |||
⚫ | |||
=={{header|Stata}}== |
=={{header|Stata}}== |
||
Line 1,992: | Line 1,998: | ||
End Module |
End Module |
||
</lang> |
</lang> |
||
=={{header|Wart}}== |
=={{header|Wart}}== |
||
<lang wart>system "ls"</lang> |
<lang wart>system "ls"</lang> |