How to distinguish command sources in tclsh

40 views Asked by At

In tclsh, An executable command can come from the tcl itself(puts set), from c-code(MyProcA MyProcB), or from the linux environment(echo vim). Assuming that I've got commands that have already been executed via history, how should I distinguish between the sources of these commands?

1

There are 1 answers

0
Donal Fellows On

Direct running of echo is a feature of the command unknown. Normally, you'd need to do exec echo...

Apart from that, there isn't really much of a distinction between commands supplied by the Tcl implementation, commands defined by third-party extensions, and (to a lesser extent) commands defined by calling something like proc. They're all just commands. Some of those commands support additional introspection, e.g., via info body or info object, but that doesn't make them any less a command than something that's handled by compilation to Tcl's bytecode or as a piece of C code.