tclsh

What is tclsh's equivalent of bash's -c (run command)?


I need something similar:

$ tclsh --run-command puts hello

to print out: hello.

Like -c in bash.


Solution

  • The simplest is to create a TCL script: runner.tcl with the following content:

    #runner.tcl
    
    eval $argv
    

    Use:

    $ tclsh runner.tcl puts hello