The Tcl Administration pages support editing shared and private scripts, and copying shared scripts to the private area.
Follow the Tcl Scripting link on the server administration page (/NS/Admin). The relevant options on the Tcl Scripting page are:
View/Edit Private Script Files: If you follow this link, a page is displayed that lists all the scripts and script directories in the private Tcl directory for the current virtual server. You can follow a link to a script to view or edit it, or you can follow a link to a directory to see the scripts in the directory, which you can then view or edit.
You also have the option to create a new script in the private Tcl directory or create a new subdirectory in the private Tcl directory.
View/Edit Shared Script Files: If you follow this link, a page is displayed that lists all the scripts and script directories in the shared Tcl directory. You can follow a link to a script to view or edit it, or you can follow a link to a directory to see the scripts in the directory, which you can then view or edit. For example:
If you follow the link to a script, you can click the Copy to Private button to copy the script to the private Tcl directory so you can make modifications to it for a specific virtual server.
You also have the option to create a new script in the shared Tcl directory or create a new subdirectory in the shared Tcl directory.
Test your script by accessing an URL that it is registered for. For example, if you registered the hello script to the /example/hello URL as follows:
ns_register_proc GET /example/hello hello
Then you would test the script by visiting the URL http://yourserver/example/hello.
The ClientDebug parameter, set in the [ns/server/server-name/tcl] section of the configuration file, allows you to specify an IP address to be enabled for Tcl debugging. If an IP address is specified with this parameter, error backtraces resulting from running a Tcl script are inserted into the page. You can have multiple ClientDebug entries to specify multiple addresses. For example:
You can also enable Client Debugging from the server administration page. Follow the Tcl Scripting link on the server administration page (/NS/Admin). Then follow the Enable/Disable Client Debugging link to enable or disable client debugging for a specific IP address.
After testing your script, you may want to make changes to it. Follow the Tcl Scripting link on the server administration page (/NS/Admin). Then follow the link to view or edit script files in the appropriate library (private or shared). Then follow the link to your script.
Before modifying your script, you should perform a Reload to make sure you have the most current version of the script, because you or someone else may have made edits to the script since the last time the page was cached. If you do make edits to an older version of the script, you will receive an error when you press the Update Script button, and your edits will not take effect.
Press the Update Script button to update and evaluate your script. To test your revised script, open the URL associated with the script (such as the /example/hello URL in the above example) again in your browser and perform a Reload to see the new results.