This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

dealing with 'exec tclsh "$0" "$@"

Old posts that have not been replied to for several years.
Locked
o
otterboyy

Post by otterboyy »

can seem to get this to work:
******
#!/bin/sh
exec tclsh "$0" "$@"
set dir [file dirname [info script]]
puts $dir
set pwd [exec pwd]
puts $pwd
********

ofcourse the script works fine if I use tclsh scriptname.tcl and have removed the exe tclsh.. line, but I'm trying to understand how to use this function.
all help appreciated!!

Otterboyy


g
guppy
eggdrop engineer
Posts: 199
Joined: Mon Sep 24, 2001 8:00 pm
Location: Canada
Contact:

Post by guppy »

#!/bin/sh
#
exec tclsh "$0" "$@"

I believe the tcl manual even says that.
o
otterboyy

Post by otterboyy »

yup..
was one of those days where I just couldn't see the obvious.
Thanks guppy!

Otterboyy
Locked