Hello,
Just wondering how come I can do these from within TCL (exactly the same as I would type in the bash prompt):
exec /sybase/ase12.5/OCS-12_5/bin/isql -Uuser -S Ftest -P user123 -i $queryFile -o $recordSetFile -w 800
exec chmod 755 $file
But not this:
exec echo "col1 col2 col3"
It appears that for the first one, TCL took whatever is after the "exec" keyword and execute them in the normal shell. However, this certainly isn't the case which explains why the second one didn't work. However, I'm not able to determine why. Any ideas?
I've also see the following works:
[procName argName]
And simply procName argName without the brackets. So when should I use bracket and when shouldn't I?
Can someone point me to an example of eval?
Also the following works:
puts {echo col1 col2 col3 | awk {{ print $1 }}}
However, all that it is doing is to print the statement without executing it.
Quote:
Originally Posted by jlinkels
It is way off to call that Bash statement from TCL. Like Bigearsbilly said, you should use the split statement.
If you have good reasons to call a Bash string from TCL, this won't work. First you need to use the eval command to get the paramters passed to Bash, secondly piping probably won't work as the pipe is seen as an additional parameter.
What is your reason to refer to TCL anyway?
jlinkels
|