equal
deleted
inserted
replaced
32 |
32 |
33 " |
33 " |
34 ! |
34 ! |
35 |
35 |
36 examples |
36 examples |
37 " |
37 " |
|
38 [exBegin] |
38 |outStream| |
39 |outStream| |
39 |
40 |
40 outStream := '' writeStream. |
41 outStream := '' writeStream. |
41 |
42 |
42 self new |
43 OSProcess new |
43 command:'ls -l'; |
44 command:'ls -l'; |
44 inStream:'abc' readStream; |
45 inStream:'abc' readStream; |
45 outStream:outStream; |
46 outStream:outStream; |
46 lineWise:true; |
47 lineWise:true; |
47 execute. |
48 execute. |
48 |
49 |
49 outStream contents |
50 outStream contents |
50 " |
51 [exEnd] |
51 |
52 |
52 " |
53 [exBegin] |
53 |outStream| |
54 |outStream| |
54 |
55 |
55 outStream := '' writeStream. |
56 outStream := '' writeStream. |
56 |
57 |
57 self new |
58 OSProcess new |
58 command:'ls -l; sleep 10; echo =================================; echo hallo after 10s; echo >&2 +++++++++++++++++++++; cat >&2'; |
59 command:'ls -l; sleep 10; echo =================================; echo hallo after 10s; echo >&2 +++++++++++++++++++++; cat >&2'; |
59 inStream:'abc' readStream; |
60 inStream:'abc' readStream; |
60 outStream:outStream; |
61 outStream:outStream; |
61 errorStream:outStream; |
62 errorStream:outStream; |
62 startProcess. |
63 startProcess. |
63 |
64 |
64 outStream inspect |
65 outStream inspect |
65 " |
66 [exEnd] |
66 |
67 |
67 " |
68 [exBegin] |
68 |outStream| |
69 |outStream| |
69 |
70 |
70 outStream := '' writeStream. |
71 outStream := '' writeStream. |
71 |
72 |
72 self new |
73 OSProcess new |
73 command:'ls -l & ls -l >&2'; |
74 command:'ls -l & ls -l >&2'; |
74 inStream:'abc' readStream; |
75 inStream:'abc' readStream; |
75 outStream:outStream; |
76 outStream:outStream; |
76 errorStream:outStream; |
77 errorStream:outStream; |
77 startProcess. |
78 startProcess. |
78 |
79 |
79 outStream inspect |
80 outStream inspect |
80 " |
81 [exEnd] |
|
82 |
|
83 Execute commands in shell/cmd.exe and read them from stdin: |
|
84 |
|
85 [exBegin] |
|
86 |outStream| |
|
87 |
|
88 outStream := '' writeStream. |
|
89 |
|
90 OSProcess new |
|
91 command:''; |
|
92 inStream:'ls -l' readStream; |
|
93 outStream:outStream; |
|
94 lineWise:true; |
|
95 execute. |
|
96 |
|
97 outStream contents inspect |
|
98 [exEnd] |
|
99 " |
81 ! ! |
100 ! ! |
82 |
101 |
83 !OSProcess class methodsFor:'instance creation'! |
102 !OSProcess class methodsFor:'instance creation'! |
84 |
103 |
85 new |
104 new |