File: retkman.tcl

package info (click to toggle)
tkman 2.2-2etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 928 kB
  • ctags: 291
  • sloc: tcl: 8,264; sh: 400; makefile: 242
file content (28 lines) | stat: -rw-r--r-- 716 bytes parent folder | download | duplicates (4)
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
#	re-tkman, suggested by Howard Moftich
#
#	kill if necessary, then restart TkMan
#	for use after changes to the MANPATH in the shell, as by a modules package

# kill old TkMen
set tkmen {}
foreach interp [winfo interps] {if {[string match "tkman*" $interp]} {lappend tkmen $interp}}

set cnt [llength $tkmen]
if {$cnt==1} {
	catch {send tkmen "manSave; exit 0"}
} elseif {$cnt>1} {
	# if multiple instantiations, find one on same machine
	set hostname [info hostname]
	foreach man $tkmen {
		if {[send $man info hostname] eq $hostname} {
			catch {send $man "manSave; exit 0"}
			break
		}
	}
}

# start a new one, with this script's MANPATH
exec tkman &

# exit this interpreter
exit 0