Problem with executing a hell command from tcl
I ain't a tcl crack but I am trying to improve the situation. I want to execute a linux shell command:
exec grep Title [lindex $argv 0] | awk '{print $2}' > tmp.txt
so far so good, but I get a message:
Error in startup script: can't read "2": no such variable
while executing
"exec grep Title [lindex $argv 0] | awk '{print $2}' > tmp.txt"
(file "/home/q275880/tcl/quick_plot.tcl" line 7)
well yes, I want to pass the $2 in such a form to linux shell but somehow tcl
takes it as its own variable. I already tried putting the command in quotes and
stuff, unfortunately with little success.
Any ideas?
|