set fullpath "/usr/home/clif/TCL_STUFF/TclTutor/Lsn.17" set relativepath "CVS/Entries" set directorypath "/usr/bin/" set paths [list $fullpath $relativepath $directorypath] foreach path $paths { set first [string first "/" $path]; set last [string last "/" $path]; incr last; if {$first != 0} { puts "$path is a relative path" } if {$last != [string length $path]} { set name [string range $path $last end]; puts "The filename is $name" } else { incr last -1; set tmp [string range $path 0 $last]; set last [string last "/" $tmp]; incr last; name [string range $tmp $last end] puts "The final word in the directory path is $name" } if {[string match "*CVS*" $path]} { puts "$path is part of the source code control tree" } set comparison [string compare $name "AA"] if {$comparison < 0} { puts "$name starts with a lowercase letter" } else { puts "$name starts with an uppercase letter" } }