set exebase [file rootname [file tail [info nameofexecutable]]] puts stdout "------------------------" puts stdout "message from script" puts stdout "exebase : $exebase" puts stdout "::tcl_interactive : $::tcl_interactive" puts stdout "::tclsh(istty) : $::tclsh(istty)" puts stdout "------------------------" if {!$::tcl_interactive} { set data [read stdin] puts stdout "stdin read: [string length $data] bytes" puts stdout $data } if {"-dorepl" in $::argv} { set ::tclsh(dorepl) 1 set ::tcl_interactive 1 }