ofcourse, I'm new to TCL and programming as a whole.
over the last few weeks I've been teaching myself TCL with a fair amount of success. Right now, however, I can't seem to get the 'exec tclsh "$0" "$@"' to work.
It's not a major issue for me, but I'm trying to understand it.
Code example:
#!/bin/sh
exec tclsh "$0" "$@"
set dir [file dirname [info script]]
puts $dir
set pwd [exec pwd]
puts $pwd
***********
what I get when I try to run (./dirtest.tcl) is:
can't read "0": no such variable
while executing
"exec tclsh "$0" "$@""
(file "./dirtest.tcl" line 2)
what am I doing wrong?
Thanks in advance!!!
Marknel
over the last few weeks I've been teaching myself TCL with a fair amount of success. Right now, however, I can't seem to get the 'exec tclsh "$0" "$@"' to work.
It's not a major issue for me, but I'm trying to understand it.
Code example:
#!/bin/sh
exec tclsh "$0" "$@"
set dir [file dirname [info script]]
puts $dir
set pwd [exec pwd]
puts $pwd
***********
what I get when I try to run (./dirtest.tcl) is:
can't read "0": no such variable
while executing
"exec tclsh "$0" "$@""
(file "./dirtest.tcl" line 2)
what am I doing wrong?
Thanks in advance!!!
Marknel