This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1 @@
"ls" run-process wait-for-process

View file

@ -0,0 +1,8 @@
class Main
{
public static Void main ()
{
p := Process (["ls"])
p.run
}
}

View file

@ -0,0 +1 @@
Start,Programs,Accessories,MSDOS Prompt,Type:dir[enter]

View file

@ -0,0 +1,2 @@
SYSTEM(CoMmand='pause')
SYSTEM(CoMmand='dir & pause')

View file

@ -0,0 +1 @@
$ls

View file

@ -0,0 +1 @@
spawn,"ls",result

View file

@ -0,0 +1 @@
spawn,"ls",unit=unit

View file

@ -0,0 +1,6 @@
procedure main()
write("Trying command ",cmd := if &features == "UNIX" then "ls" else "dir")
system(cmd)
end

View file

@ -0,0 +1,2 @@
pid := system(command_string,&input,&output,&errout,"wait")
pid := system(command_string,&input,&output,&errout,"nowait")

View file

@ -0,0 +1 @@
System runCommand("ls") stdout println

View file

@ -0,0 +1,15 @@
load'task'
NB. Execute a command and wait for it to complete
shell 'dir'
NB. Execute a command but don't wait for it to complete
fork 'notepad'
NB. Execute a command and capture its stdout
stdout =: shell 'dir'
NB. Execute a command, provide it with stdin,
NB. and capture its stdout
stdin =: 'blahblahblah'
stdout =: stdin spawn 'grep blah'

View file

@ -0,0 +1 @@
"ls" system.

View file

@ -0,0 +1 @@
\ls

View file

@ -0,0 +1 @@
r: 4:"ls"

View file

@ -0,0 +1 @@
'ls system

View file

@ -0,0 +1,2 @@
drive1$ = left$(Drives$,1)
run "cmd.exe /";drive1$;" dir & pause"

View file

@ -0,0 +1 @@
print first butfirst shell [ls -a] ; ..

View file

@ -0,0 +1 @@
syscmd(ifdef(`__windows__',`dir',`ls'))

View file

@ -0,0 +1 @@
dosCommand "pause"

View file

@ -0,0 +1 @@
Set X=$ZF(-1,"DIR")

View file

@ -0,0 +1 @@
ZSY "DIR"

View file

@ -0,0 +1 @@
ZSY "ls"

View file

@ -0,0 +1,2 @@
contents=$(shell cat foo)
curdir=`pwd`

View file

@ -0,0 +1,2 @@
mytarget:
cat foo | grep mytext

View file

@ -0,0 +1 @@
system("dir > list.txt")$

View file

@ -0,0 +1,10 @@
:- module execute_sys_cmd.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
main(!IO) :-
io.call_system("ls", _Result, !IO).

View file

@ -0,0 +1,34 @@
MODULE tri;
FROM SYSTEM IMPORT ADR;
FROM SysLib IMPORT system;
IMPORT TextIO, InOut, ASCII;
VAR fd : TextIO.File;
ch : CHAR;
PROCEDURE SystemCommand (VAR command : ARRAY OF CHAR) : BOOLEAN;
BEGIN
IF system (ADR (command) ) = 0 THEN
RETURN TRUE
ELSE
RETURN FALSE
END
END SystemCommand;
BEGIN
IF SystemCommand ("ls -1 tri.mod | ") = TRUE THEN
InOut.WriteString ("No error reported.")
ELSE
InOut.WriteString ("Error reported!")
END;
LOOP
InOut.Read (ch);
InOut.Write (ch);
IF ch < ' ' THEN EXIT END
END;
InOut.WriteLn;
InOut.WriteBf
END tri.

View file

@ -0,0 +1,10 @@
UNSAFE MODULE Exec EXPORTS Main;
IMPORT Unix, M3toC;
VAR command := M3toC.CopyTtoS("ls");
BEGIN
EVAL Unix.system(command);
M3toC.FreeCopiedS(command);
END Exec.