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]

 

posted @ 2011-08-30 23:13  greencolor  阅读(108)  评论(0编辑  收藏  举报