1: #!/bin/sh 2: # the next line restarts using tclsh \ 3: exec tclsh "$0" "$@" 4: 5: # Parse a rivet file and execute it. 6: 7: set auto_path "[file dirname [info script]] $auto_path" 8: package require tclrivet 9: 10: proc main {} { 11: global argv 12: 13: for {set i 0} {$i < [llength $argv] - 1} {incr i} { 14: source [lindex $argv $i] 15: } 16: set script [rivet::parserivet [lindex $argv end]] 17: if { [catch {eval $script } err] } { 18: puts "Error: $err" 19: } 20: } 21: 22: main |