exec ?switches? arg ?arg ...?
If the initial arguments to exec start with - then they are treated as command-line switches and are not part of the pipeline specification. The following switches are currently supported:
The Tk console text widget does not provide real standard IO capabilities. Under Tk, when redirecting from standard input, all applications will see an immediate end-of-file; information redirected to standard output or standard error will be discarded.
Either forward or backward slashes are accepted as path separators for arguments to Tcl commands. When executing an application, the path name specified for the application may also contain forward or backward slashes as path separators. Bear in mind, however, that most Windows applications accept arguments with forward slashes only as option delimiters and backslashes only in paths. Any arguments to an application that specify a path name with forward slashes will not automatically be converted to use the backslash character. If an argument contains forward slashes as the path separator, it may or may not be recognized as a path name, depending on the program.
Additionally, when calling a 16-bit DOS or Windows 3.X application, all path names must use the short, cryptic, path format (e.g., using ``applba~1.def'' instead of ``applbakery.default'').
Two or more forward or backward slashes in a row in a path refer to a network path. For example, a simple concatenation of the root directory c:/ with a subdirectory /windows/system will yield c://windows/system (two slashes together), which refers to the directory /system on the machine windows (and the c:/ is ignored), and is not equivalent to c:/windows/system, which describes a directory on the current computer.
In order to execute the shell builtin commands like dir and copy, the caller must prepend ``cmd.exe /c '' to the desired command.
In order to execute the shell builtin commands like dir and copy, the caller must prepend ``command.com /c '' to the desired command.
Once a 16-bit DOS application has read standard input from a console and then quit, all subsequently run 16-bit DOS applications will see the standard input as already closed. 32-bit applications do not have this problem and will run correctly even after a 16-bit DOS application thinks that standard input is closed. There is no known workaround for this bug at this time.
Redirection between the NUL: device and a 16-bit application does not always work. When redirecting from NUL:, some applications may hang, others will get an infinite stream of ``0x01'' bytes, and some will actually correctly get an immediate end-of-file; the behavior seems to depend upon something compiled into the application itself. When redirecting greater than 4K or so to NUL:, some applications will hang. The above problems do not happen with 32-bit applications.
All DOS 16-bit applications are run synchronously. All standard input from a pipe to a 16-bit DOS application is collected into a temporary file; the other end of the pipe must be closed before the 16-bit DOS application begins executing. All standard output or error from a 16-bit DOS application to a pipe is collected into temporary files; the application must terminate before the temporary files are redirected to the next stage of the pipeline. This is due to a workaround for a Windows 95 bug in the implementation of pipes, and is how the Windows 95 command line interpreter handles pipes itself.
Certain applications, such as command.com, 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.
In order to execute the shell builtin commands like dir and copy, the caller must prepend ``command.com /c '' to the desired command.
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.
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 exec command cannot be used to start an application in the background.
When standard input is redirected from an open file using the ``@ fileId'' 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.
Copyright © 1989-1994 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.