I am just learning TCL and am trying to modify this script. Everything works, except that it won't let me cd into a directory that contains charecters like periods and hyphens. I'm having a hard time figuring out what this is doing, but I think its trying to expand the current direcotry to *.* and then compare the cd arguments before changing to the new directory. Is this correct? Could this be where it is choking when the directory contains a period?
#Prog FLASH cd command
if {$args == "cd.."} {
set args "cd";
set filematch "..";
};
if [string match $args "cd" ] {
set chdir $filematch;
if {$chdir == ".."} {
set newdir [string range $activedir 0 [expr [string last "/" $activedir]-1]];
if {[string last "/" $activedir]<0} { set newdir "." };
set wholist [lreplace $wholist $infoseek [expr $infoseek+1] $ip $newdir]; set command 1
};#if
if {$chdir == "/"} {set wholist [lreplace $wholist $infoseek [expr $infoseek+1] $ip "."]; set command 1
};#if
if {$command!=1 && ![string match "*.*" $chdir]} {
if {$chdir != ".."} {
set chdir [string trimright $chdir "/"];
if {[string match $activedir "."] && [file isdirectory "$basedir/$chdir"]} {
set wholist [lreplace $wholist $infoseek [expr $infoseek+1] $ip $chdir] ; set command 1
};#if
if {![string match $activedir "."] && [file isdirectory "$basedir/$activedir/$chdir"]} {
set chdir [string trimright $chdir "/"];
set wholist [lreplace $wholist $infoseek [expr $infoseek+1] $ip "$activedir/$chdir"]; set command 1
};#if
};#if
};#if
if {$command==1} { ircii /msg =$name "^C15^B[^B^C12 [lindex $wholist [expr $infoseek+1]] ^B^C15]" };
if {$command!=1} {
ircii /msg =$name "No such directory!"
set command 1
};#if
};#prog if cd
<font size=-1>[ This Message was edited by: prizm on 2002-06-04 14:45 ]</font>