/usr/share/tcltk/tcllib1.18/tool/script.tcl is in tcllib 1.18-dfsg-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ###
# Add configure by script facilities to TOOL
###
::tool::define ::tool::object {
###
# Allows for a constructor to accept a psuedo-code
# initialization script which exercise the object's methods
# sans "my" in front of every command
###
method Eval_Script script {
set buffer {}
set thisline {}
foreach line [split $script \n] {
append thisline $line
if {![info complete $thisline]} {
append thisline \n
continue
}
set thisline [string trim $thisline]
if {[string index $thisline 0] eq "#"} continue
if {[string length $thisline]==0} continue
if {[lindex $thisline 0] eq "my"} {
# Line already calls out "my", accept verbatim
append buffer $thisline \n
} elseif {[string range $thisline 0 2] eq "::"} {
# Fully qualified commands accepted verbatim
append buffer $thisline \n
} elseif {
append buffer "my $thisline" \n
}
set thisline {}
}
eval $buffer
}
}
|