#!/bin/sh # \ exec tclsh "$0" ${1+"$@"} set cnt 1 foreach el [split $env(PATH) ":"] { set el [string trimright $el /] if { ! [array exists path] || [array names path *,$el] == "" } { set path([format "%03d" $cnt],$el) 1 } incr cnt } foreach el [lsort [array names path]] { append res "[string range $el 4 end]:" } set res [string trimright $res :] puts $res