When I work under tcl environment, once I cd to a directory, even if the path I specify is its symbolic link, then no matter whether I run pwd -L or pwd -P, they all return the absolute path. This is troublesome for me because I try to replace a user-specific workspace path with a variable name so that when different user execute the script, they will switch to their own workspace. However, the system $::env(WORK) returns the symbolic link of the path while pwd command returns the absolute path, so that I cannot do an sed command.
For example,
stcl> cd $::env(WORK)
stcl> puts [format "cd %s" [exec echo [pwd] | sed "s,$::env(WORK),\$WORK,g"]]
What I want the code to do is to print "cd $WORK", but because pwd returns absolute path, even if I use pwd -L, I cannot get a match with sed command and therefore cannot replace the string.