1#!/bin/bash 2#\ 3exec wish "$0" -- ${1+"$@"} 4 5source [exec bash -c "which source.tcl"] 6my_source [list print.tcl opt.tcl] 7 8longoptions test_mode:=0 quiet:=0 9pos_parms 10 11 12# Create help dictionary for call to gen_print_help. 13set help_dict [dict create\ 14 ${program_name} [list "${program_name} will..."]\ 15] 16 17 18proc help {} { 19 20 gen_print_help 21 22} 23 24 25proc exit_proc { {ret_code 0} } { 26 27 # Execute whenever the program ends normally or with the signals that we catch (i.e. TERM, INT). 28 29 dprint_executing 30 dprint_var ret_code 31 32 # Your code here. 33 34 qprint_pgm_footer 35 36 exit $ret_code 37 38} 39 40 41proc validate_parms {} { 42 43 trap { exit_proc } [list SIGTERM SIGINT] 44 45 # Your code here. 46 47} 48 49 50# Main 51 52 gen_get_options $argv 53 54 validate_parms 55 56 qprint_pgm_header 57 58 exit_proc 59