initial commit of bin scripts into git
This commit is contained in:
17
clean_path
Executable file
17
clean_path
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user