4 ms·
That depends upon your definition of "integrate". It can read/write stdin/stdout (just as any scripting language can) so it can be used to write additional fil
by pwg 10y ago
That depends upon your definition of "integrate".
It can read/write stdin/stdout (just as any scripting language can) so it can be used to write additional filters/tools that don't exist in the standard set that can then be used from shell as with any other tool.
But if you mean using it to create a pipeline out of existing command line tools, then yes, but with a bit more boilerplate than plain shell needs. The built in "exec" command has an almost shell syntax for starting pipelines, and the "open" command supports the same syntax, so it is 98% "as well" in that regard. But to avoid getting stuck in a deadlock trying to write data to a pipeline that is returning filtered data to the script requires turning on Tcl's event driven file IO, which is where the extra boilerplate comes from.
- vram22 10y ago>That depends upon your definition of "integrate". I meant roughly all that can be done with shell, except maybe somewhat differently (due to Tcl's different syntax or features). The usual things: call existing command-line tools, write scripts in which you use its own syntax/features as well as call / pipe between / orchestrate command line tools, redirect std I/O, etc. - the things that make the shell powerful. Thanks for the reply. Seems like it is close to equivalent from what you say.