open

open - Open a file-based or command pipeline channel
This command opens a file, serial port, or command pipeline and returns a channel identifier that may be used in future invocations of commands like read, puts, and close. If the first character of fileName is not | then the command opens a file
If the first character of fileName is ``|'' then the remaining characters of fileName are treated as a list of arguments that describe a command pipeline to invoke, in the same style as the arguments for exec.


set fl [open "| ls "]
set data [read $fl]     # set data [gets $fl]

原文地址:https://www.cnblogs.com/greencolor/p/2160157.html