File: os_system.html

package info (click to toggle)
freemat 4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 174,756 kB
  • ctags: 67,023
  • sloc: cpp: 351,059; ansic: 255,892; sh: 40,590; makefile: 4,387; perl: 4,058; asm: 3,313; pascal: 2,718; fortran: 1,722; ada: 1,681; ml: 1,360; cs: 879; csh: 795; python: 430; sed: 162; lisp: 160; awk: 5
file content (267 lines) | stat: -rw-r--r-- 4,811 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<HTML>
<HEAD>
<TITLE>SYSTEM Call an External Program
</TITLE>
</HEAD>
<BODY>
<H2>SYSTEM Call an External Program
</H2>
<P>
Section: <A HREF=sec_os.html> Operating System Functions </A>
<H3>Usage</H3>
The <code>system</code> function allows you to call an external
program from within FreeMat, and capture the output.
The syntax of the <code>system</code> function is
<PRE>
  y = system(cmd)
</PRE>
<P>
where <code>cmd</code> is the command to execute.  The return
array <code>y</code> is of type <code>cell-array</code>, where each entry
in the array corresponds to a line from the output.
<H3>Example</H3>
Here is an example of calling the <code>ls</code> function (the
list files function under Un*x-like operating system).
<PRE>
--&gt; y = system('ls')

y = 

 Columns 1 to 3

 [chain1.m] [chain2.m] [chain3.m] 

 Columns 4 to 6

 [conv2_eqn1.png] [conv2_eqn.aux] [conv2_eqn.dvi] 

 Columns 7 to 9

 [conv2_eqn.log] [conv2_eqn.tex] [cumprod_eqn1.png] 

 Columns 10 to 12

 [cumprod_eqn.aux] [cumprod_eqn.dvi] [cumprod_eqn.log] 

 Columns 13 to 15

 [cumprod_eqn.tex] [cumsum_eqn1.png] [cumsum_eqn.aux] 

 Columns 16 to 18

 [cumsum_eqn.dvi] [cumsum_eqn.log] [cumsum_eqn.tex] 

 Columns 19 to 21

 [do_jit_test.m] [eig_eqn1.png] [eig_eqn2.png] 

 Columns 22 to 24

 [eig_eqn3.png] [eig_eqn4.png] [eig_eqn5.png] 

 Columns 25 to 27

 [eig_eqn6.png] [eig_eqn.aux] [eig_eqn.dvi] 

 Columns 28 to 30

 [eig_eqn.log] [eig_eqn.tex] [evenoddtest.m] 

 Columns 31 to 33

 [fft1.jpg] [fft1.png] [fft2.jpg] 

 Columns 34 to 36

 [fft2.png] [fft_eqn1.png] [fft_eqn2.png] 

 Columns 37 to 39

 [fft_eqn3.png] [fft_eqn4.png] [fft_eqn.aux] 

 Columns 40 to 42

 [fft_eqn.dvi] [fft_eqn.log] [fft_eqn.tex] 

 Columns 43 to 45

 [find_eqn1.png] [find_eqn.aux] [find_eqn.dvi] 

 Columns 46 to 48

 [find_eqn.log] [find_eqn.tex] [help] 

 Columns 49 to 51

 [jit_test001.m] [jit_test002.m] [jit_test003.m] 

 Columns 52 to 54

 [jit_test004.m] [jit_test005.m] [jit_test006.m] 

 Columns 55 to 57

 [jit_test007.m] [jit_test008.m] [jit_test009.m] 

 Columns 58 to 60

 [jit_test010.m] [jit_test011.m] [jit_test012.m] 

 Columns 61 to 63

 [jit_test013.m] [jit_test014.m] [jit_test015.m] 

 Columns 64 to 66

 [jit_test016.m] [jit_test017.m] [jit_test018.m] 

 Columns 67 to 69

 [jit_test019.m] [jit_test020.m] [jit_test021.m] 

 Columns 70 to 72

 [jit_test022.m] [jit_test023.m] [jit_test024.m] 

 Columns 73 to 75

 [loadsave.dat] [max_eqn1.png] [max_eqn2.png] 

 Columns 76 to 78

 [max_eqn3.png] [max_eqn.aux] [max_eqn.dvi] 

 Columns 79 to 81

 [max_eqn.log] [max_eqn.tex] [mean_eqn1.png] 

 Columns 82 to 84

 [mean_eqn.aux] [mean_eqn.dvi] [mean_eqn.log] 

 Columns 85 to 87

 [mean_eqn.tex] [min_eqn1.png] [min_eqn2.png] 

 Columns 88 to 90

 [min_eqn3.png] [min_eqn.aux] [min_eqn.dvi] 

 Columns 91 to 93

 [min_eqn.log] [min_eqn.tex] [nargintest.m] 

 Columns 94 to 96

 [nargouttest.m] [source_test] [source_test_script.m] 

 Columns 97 to 99

 [test_assignin1.m] [test_assignin2.m] [test_bin2int1.m] 

 Columns 100 to 102

 [test_bitand1.m] [test_bitor1.m] [test_bitxor1.m] 

 Columns 103 to 105

 [test.bmp] [test_builtin1.m] [test_cell1.m] 

 Columns 106 to 108

 [test_clear1.m] [test_clear2.m] [test_conv2_1.m] 

 Columns 109 to 111

 [test_ctype1.m] [test.dat] [test_dcomplex1.m] 

 Columns 112 to 114

 [test_diag1.m] [test_diag2.m] [test_diag3.m] 

 Columns 115 to 117

 [test_diag4.m] [test_diag5.m] [test_dlmread1.m] 

 Columns 118 to 120

 [test_eig1.m] [test_eig2.m] [test_eig3.m] 

 Columns 121 to 123

 [test_eig4.m] [test_eig5.m] [test_eig6.m] 

 Columns 124 to 126

 [test_empty.m] [test_eps1.m] [test_error1.m] 

 Columns 127 to 129

 [test_eval1.m] [test_eval2.m] [test_eval3.m] 

 Columns 130 to 132

 [test_evalin1.m] [test_evalin2.m] [test_exist1.m] 

 Columns 133 to 135

 [test_exist2.m] [test_feval1.m] [test_fieldnames1.m] 

 Columns 136 to 138

 [test_imwrite_imread.m] [test_int2bin1.m] [test_isset1.m] 

 Columns 139 to 141

 [test_jit.m] [test_lasterr1.m] [test_load1.m] 

 Columns 142 to 144

 [test_lu1.m] [test_lu2.m] [test_nargin1.m] 

 Columns 145 to 147

 [test_nargin2.m] [test_permute1.m] [test_permute2.m] 

 Columns 148 to 150

 [test_repmat1.m] [test_repmat2.m] [test_repmat3.m] 

 Columns 151 to 153

 [test_save1.m] [test_source.m] [test_sparse20.m] 

 Columns 154 to 156

 [test_sparse21.m] [test_sparse45.m] [test_sparse58.m] 

 Columns 157 to 159

 [test_sparse68.m] [test_sparse70.m] [test_sparse74.m] 

 Columns 160 to 162

 [test_sparse75.m] [testtext] [test_typeof1.m] 

 Columns 163 to 165

 [test_typeof2.m] [test_typeof3.m] [test_typeof4.m] 

 Columns 166 to 168

 [test_typeof5.m] [test_typeof6.m] [test_uint64_1.m] 

 Columns 169 to 169

 [toolbox] 

--&gt; y{1}

ans = 
chain1.m
</PRE>
<P>
</BODY>
</HTML>