Andrew,

global argv
set nsd_with_path [lindex $argv 0]

Now $nsd_with_path has possibly what you want. Works for me at the top
of nsd.tcl
You might need to somehow massage this if you start nsd relative to you
pwd. Maybe using the pwd command with this.


Andrew Piskorski wrote:

Is there any Tcl command which to tell me the the command used to
start nsd, which I can use WHILE sourcing the nsd.tcl config file?

For example, if I start nsd with /web/aol3/bin/nsd, [ns_library
shared] will return "/web/aol3/modules/tcl", which would work for
this, EXCEPT that the ns_library command doesn't work at all during
AOLserver startup, while sourcing the nsd.tcl config file.

So far, the only thing I can think of that would work is to set an
environment variable before running nsd, and then get at that variable
via the Tcl global env array from inside nsd.  Which is kind of ugly.
Instead, is there any way to let me access the command line used to
start nsd directly?

I would like to do that, in order to set other things in nsd.tcl based
on where the nsd binary is.  E.g., with "/web/aol3/bin/nsd", I want to
all logs to go into "/web/aol3/log".

--
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com




Reply via email to