Re: forking a subprocess under scotty

Simon Chow (skchow@cisco.com)
Fri, 28 Mar 1997 08:30:52 -0800

My solution to the problem is to use the "fork" command from Expect, Simply
start your problem this way:

#!/bin/sh
# Don't delete this line \
exec tclsh "$0" "$@"

package require Tnm 2.1.5
package require Expect 5.21

Now you have access to the "fork" command. I have been using this approach
for a while, it works well for me.

/Simon

At 09:02 AM 3/10/97 -0500, Cary B. O'Brien wrote:
>>
>> Hi, everybody !!
>> Does anyone know how can I make fork() in scotty , i. e. I need to
>> call a programm(or tcl script, or something ) from scotty tcl script
>> so that the "farther" script won`t wait till his child returns. A just
>> start some new process working on it's own and continue to do my job
>> in the parent .
>>
>This is more difficult than it seems. Or at least I usually have more
>trouble with it than I expect!
>
>You would think that you could jjust do exec cmd &, but tcl still waits
>for stdout/stderr to close so it can get the result code, I think.
>
>At one job we had to have tk callbacks rsh to another machine and start
>things up. It took a LONG time to get things to work ok. At every
>step, it seemed, we had to redirect stdin/stdout/stderror to/from
>dev null. Sometimes you also have to use an intermediate shell script
>that just starts what you want to do and exits to prevent zombies.
>
>Could be worse. YOu could be using exec under NT. The TCL developers
>said that there were 60 some-odd variations.
>
>Post whatever you get working!
>
>Good luck
>-- cary
>cobrien@access.digex.net
>
>--
>!! This message is brought to you via the `tkined & scotty' mailing list.
>!! Please do not reply to this message to unsubscribe. To subscribe or
>!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
>!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.
>
>

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.