tcl "grandchild" processes creating cmd windows 
Author Message
 tcl "grandchild" processes creating cmd windows

Background:   I have a tcl/tk wrapper around a shell script, and that shell
script does rsh's out to systems.  It ran on a Sun and worked fine.  I can
run it fine on Win2k with cygwin installed.

Problem:   I've converted the shell script to perl, but now each rsh
generates a separate cmd window.  When the perl script is run by itself it
doesn't do this, only when it's run under tcl.  This may be a perl issue,
but since it only happens when the perl process is started from under tcl,
I'm hoping there is a way to fix it in the way it's opened.

I've got examples narrowed down:

Old method: tcl, opening shell process, which uses 'rsh' and no cmd windows
appear:
test2.tcl:
   set handles [open "| bash test2.sh" r+]
   after 10000

test2.sh:
   while [ 1 ]; do
     a=`rsh iocbox3-x ls`
     echo "$a"
     sleep 4
   done

New method:  tcl, opening perl process, which uses 'rsh' and cmd windows
appear:

test1.tcl:
  set handles [open "| perl test1.pl" r+]
  after 10000

test1.pl:
   while ( 1 ) {


      sleep 4;
    }



Sun, 21 Mar 2004 21:12:51 GMT  
 tcl "grandchild" processes creating cmd windows

Quote:

> Background:   I have a tcl/tk wrapper around a shell script, and that shell
> script does rsh's out to systems.  It ran on a Sun and worked fine.  I can
> run it fine on Win2k with cygwin installed.

> Problem:   I've converted the shell script to perl, but now each rsh
> generates a separate cmd window.  When the perl script is run by itself it
> doesn't do this, only when it's run under tcl.  This may be a perl issue,
> but since it only happens when the perl process is started from under tcl,
> I'm hoping there is a way to fix it in the way it's opened.

> I've got examples narrowed down:

> Old method: tcl, opening shell process, which uses 'rsh' and no cmd windows
> appear:
> test2.tcl:
>    set handles [open "| bash test2.sh" r+]
>    after 10000

> test2.sh:
>    while [ 1 ]; do
>      a=`rsh iocbox3-x ls`
>      echo "$a"
>      sleep 4
>    done

> New method:  tcl, opening perl process, which uses 'rsh' and cmd windows
> appear:

> test1.tcl:
>   set handles [open "| perl test1.pl" r+]
>   after 10000

> test1.pl:
>    while ( 1 ) {


>       sleep 4;
>     }

Any chance that on your system "perl" is an alias or shell script wrapper that
open a window then executes the "real" perl?

Bruce



Mon, 22 Mar 2004 00:18:45 GMT  
 tcl "grandchild" processes creating cmd windows

Quote:

> > test1.tcl:
> >   set handles [open "| perl test1.pl" r+]
> >   after 10000

> Any chance that on your system "perl" is an alias or shell script wrapper
that
> open a window then executes the "real" perl?

> Bruce

Thanks for the idea.  I just tried fully qualifying it:
       set handles [open "| c:/perl/bin/perl.exe test1.pl" r+]
and it gave the same results though.  If it was the perl pipe that opened a
window, I think I'd get one window open all the time that perl script was
running.  What I get is windows poping up at each rsh and closing again
quickly - kind of like someone's wierd attempt at subliminal messaging!


Mon, 22 Mar 2004 00:40:51 GMT  
 tcl "grandchild" processes creating cmd windows

Quote:
>Thanks for the idea.  I just tried fully qualifying it:
>       set handles [open "| c:/perl/bin/perl.exe test1.pl" r+]
>and it gave the same results though.  If it was the perl pipe that opened a
>window, I think I'd get one window open all the time that perl script was
>running.  What I get is windows poping up at each rsh and closing again
>quickly - kind of like someone's wierd attempt at subliminal messaging!

Clearly then it is the perl `rsh...` invocation that is
responsible for the proliferation of (DOS?) windows.  Why don't
you write the whole thing in Tcl?

--
Glenn Jackman



Mon, 22 Mar 2004 00:54:57 GMT  
 tcl "grandchild" processes creating cmd windows

Quote:
> Clearly then it is the perl `rsh...` invocation that is
> responsible for the proliferation of (DOS?) windows.  Why don't
> you write the whole thing in Tcl?

> --
> Glenn Jackman

Well .. there are several thousand lines of shell script and they do a good
amount of bit fiddling in external calls that can be pulled inside of perl,
but not tcl...

Is there some environment parameter passed into the open'ed process that
tells it that it's not in an interactive environment and therefore it
behaves differently than when called by itself?



Mon, 22 Mar 2004 01:47:09 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. newbie help- creating windows "extension" dll

2. cgi-bin "exec": error waiting for process to exit: No child processes

3. while( "cmd" | getline ) nested

4. problem with "open |test.cmd"

5. Equivalent of "find" cmd

6. The "after" cmd

7. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

8. Windows "C" vs TCL sockets

9. Impact of "Regional Settings", locale on Tcl library in Windows

10. "Windows" with tcl-tk

11. "Out Port.vi": passing from Windows NT 4.0 to Windows 2000

12. BEGIN{want[]={"s1o", "s2o", "s2q", "s3q"}

 

 
Powered by phpBB® Forum Software