I think the answer depends on what O/S you're using and what you mean by running in the background. Let's say your on UNIX and your script runs as a command line executable:
> scriptname
In that case, you can invoke it as a background job:
> scriptname &
[I'm sure you know that so pardon the trivial first case]
On Windows, you can invoke your script and then invoke another script or executable while the first one is running. Again, somewhat trivial.
If, however, what you mean is that you want to run a proc or script portion and not wait for it to finish before you go on to another portion of the same script, that is not trivial. In fact, the only reason you would be doing that is because you want the 2 processes to communicate. In that case you probably want to open channel and use "fileevent" to mediate the communication. [From the Tcl Help file: "This command is used to create file event handlers. A file event handler is a binding between a channel and a script, such that the script is evaluated whenever the channel becomes readable or writable. File event handlers are most commonly used to allow data to be received from another process on an event-driven basis, so that the receiver can continue to interact with the user while waiting for the data to arrive. If an application invokes gets or read on a blocking channel when there is no input data available, the process will block; until the input data arrives, it will not be able to service other events, so it will appear to the user to ``freeze up''. With fileevent, the process can tell when data is present and only invoke gets or read when they won't block. "] Bob Rashkin
rrashkin@csc.com