From 78feb77d50f7e3358d2b10b50fb54472c3261769 Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Fri, 21 Apr 2023 17:49:51 +1000 Subject: [PATCH] test1.tcl a basic test scratch script --- scriptlib/test1.tcl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scriptlib/test1.tcl diff --git a/scriptlib/test1.tcl b/scriptlib/test1.tcl new file mode 100644 index 0000000..0100332 --- /dev/null +++ b/scriptlib/test1.tcl @@ -0,0 +1,32 @@ +puts -nonewline stdout "info script\r\n" +puts stdout "[info script]" +puts stdout "::argc" +puts stdout $::argc +puts stdout "::argv" +puts stdout "$::argv" +puts stdout "NS" +puts stdout "[namespace current]" + +if {[info exists ::test]} { + puts stdout "::test has existing value" + puts stdout "$::test" +} + +puts stdout "setting ::test to showargs-ran" +set ::test "showargs-ran" +puts stdout "doing basic check of stdin for data" +chan configure stdin -blocking 0 +set indata "" +if {![chan eof stdin]} { + #set indata [read stdin] +} +if {[string length $indata]} { + puts stdout "read from stdin:" + puts stdout $indata +} else { +puts stdout "-no stdin data read-" +} + + + +