1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
-
+
|
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: @(#) $Id: exec.n,v 1.3 1999/04/16 00:46:34 stanton Exp $
'\" RCS: @(#) $Id: exec.n,v 1.4 1999/12/09 14:43:47 hobbs Exp $
'\"
.so man.macros
.TH exec n 7.6 Tcl "Tcl Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
exec \- Invoke subprocess(es)
|
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
289
290
291
292
293
294
295
296
297
298
299
300
301
302
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
.sp
Certain applications, such as \fBcommand.com\fR, should not be executed
interactively. Applications which directly access the console window,
rather than reading from their standard input and writing to their standard
output may fail, hang Tcl, or even hang the system if their own private
console window is not available to them.
.RE
.TP
\fBWindows 3.X\fR
.
When attempting to execute an application, \fBexec\fR first searches for the
name as it was specified. Then, in order, \fB.com\fR, \fB.exe\fR, and \fB.bat\fR
are appended to the end of the specified name and it searches for
the longer name. If a directory name was not specified as part of the
application name, the following directories are automatically searched in
order when attempting to locate the application:
.sp
.RS
.RS
The directory from which the Tcl executable was loaded.
.br
The current directory.
.br
The Windows 3.X system directory.
.br
The Windows 3.X home directory.
.br
The directories listed in the path.
.RE
.sp
In order to execute the shell builtin commands like \fBdir\fR and \fBcopy\fR,
the caller must prepend ``\fBcommand.com /c\0\fR'' to the desired command.
.sp
16-bit and 32-bit DOS and Windows applications may be executed. However,
redirection and piping of standard IO only works with 16-bit DOS
applications. 32-bit applications always see standard input as already
closed, and any standard output or error is discarded, no matter where in the
pipeline the application occurs or what redirection symbols are used by the
caller. Additionally, for 16-bit applications, standard error is always
sent to the same place as standard output; it cannot be redirected to a
separate location. In order to achieve pseudo-redirection for 32-bit
applications, the 32-bit application must instead be written to take command
line arguments that specify the files that it should read from and write to
and open those files itself.
.sp
All applications, both 16-bit and 32-bit, run synchronously; each application
runs to completion before the next one in the pipeline starts. Temporary files
are used to simulate piping between applications. The \fBexec\fR
command cannot be used to start an application in the background.
.sp
When standard input is redirected from an open file using the
``\fB@\0\fIfileId\fR'' notation, the open file is completely read up to its
end. This is slightly different than under Windows 95 or NT, where the child
application consumes from the open file only as much as it wants.
Redirecting to an open file is supported as normal.
.RE
.TP
\fBMacintosh\fR
The \fBexec\fR command is not implemented and does not exist under Macintosh.
.TP
\fBUnix\fR\0\0\0\0\0\0\0
The \fBexec\fR command is fully functional and works as described.
|