/usr/share/cgnstools/unitconv.tcl is in cgns-convert 3.3.0-5.
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | #!/bin/sh
# the next line restarts using wish \
exec wish -f "$0" "$@"
proc error_exit {msg} {
wm withdraw .
tk_dialog .error Error $msg error 0 Exit
exit 1
}
if {[catch {package require Tk 8.0} msg]} {
error_exit $msg
}
#----- get startup directory and name
set cmd_name [file tail $argv0]
set cmd_dir [file dirname $argv0]
if {![file exists $argv0] || [file isdirectory $argv0]} {
if {$tcl_platform(platform) == "windows"} {
set sep ";"
} else {
set sep ":"
}
foreach i [split $env(PATH) $sep] {
if {$sep == ";"} {
set i [join [split $i \\] /]
}
if {[file exists $i/$cmd_name] && ![file isdirectory $i/$cmd_name]} {
set cmd_dir $i
break;
}
}
}
set curdir [pwd]
if ![catch {cd $cmd_dir}] {
set cmd_dir [pwd]
cd $curdir
}
if {$tcl_platform(platform) == "windows"} {
set cmd_dir [file attributes $cmd_dir -shortname]
}
#----- set path to tcl scripts
set auto_path "$cmd_dir $cmd_dir/../common $auto_path"
if {[info exists env(TCL_PROC_DIR)]} {
set auto_path "$env(TCL_PROC_DIR) $auto_path"
}
#---------- initialize
if [catch {config_defaults 1} msg] {error_exit $msg}
if {$tcl_platform(platform) == "windows"} {
set vers [join [split $tcl_version .] {}]
catch {load tclreg$vers registry}
}
if {[tclreg_init -base "HKEY_CURRENT_USER/Software/CGNS" \
-fname ".cgnstools"]} {
units_read
}
units:create .
catch {
config_icon . [list unitconv cgns] \
[list $cmd_dir $cmd_dir/images $cmd_dir/../common]
}
|