Ok. I have a problem in TCL that I hope someone here can help me out with. The problem is with using the 'exec/eval' command. I want to be able to execute a command where the command involves an environment variable. For example; lets say I want to say
echo $PATH
the problem is that the user is going to type in the 'command arguments' through the gui. So he/she will type in '$PATH'. The problem with that is that TCL sees that as its own local variable; due to the '$'.
The workraound would be to use the 'global env' array and write it as: echo $env(PATH) but the problem with that is that I dont know where the environment is going to appear in the arguments. The command could be:
% someProg -file $PATH/file1 $PATH/2
so it would get messy to do manual 'parsing' for a '$' and do subsitution.
Any built in tcl tricks??
thanks in advance!
Nav
echo $PATH
the problem is that the user is going to type in the 'command arguments' through the gui. So he/she will type in '$PATH'. The problem with that is that TCL sees that as its own local variable; due to the '$'.
The workraound would be to use the 'global env' array and write it as: echo $env(PATH) but the problem with that is that I dont know where the environment is going to appear in the arguments. The command could be:
% someProg -file $PATH/file1 $PATH/2
so it would get messy to do manual 'parsing' for a '$' and do subsitution.
Any built in tcl tricks??
thanks in advance!
Nav