| |||||||||||
Piping commands in TCLSH Posted by neo (The Architect), 1 May 2005 How can I pipe commands in a TCL script or in the TCL shell?Posted by admin (Graham Ellis), 1 May 2005 Use "puts" to send the output of your script to STDOUT, then use a "|" followed by the command you want to send your output to on the command line.Posted by neo (The Architect), 1 May 2005 Here is the output..Quote:
Posted by admin (Graham Ellis), 1 May 2005 Here's an example of what I meant ... using | in the shell not in Tcl.Code:
Posted by neo (The Architect), 2 May 2005 Ok.So does the TCL shell (tclsh) as such support piping? Posted by admin (Graham Ellis), 2 May 2005 The pipe character (|) has no special significance in Tcl - so, no, the Tclsh shell doesn't itself support piping. That's why the I suggested that you use a shell pipe in answer to your first question.You've really got two options to pipe commands in Tcl; you can follow my shell suggestion as made earlier in thsi thread, or you can use the open command with a pipe character as the first character of what would (otherwise) by the file name. There's an example on our web site at http://www.wellho.net/resources/ex.php4?item=t209/disc_status. This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |