http://www.scriptics.com/support/bugForm.html
Responses to this post are encouraged.
------
Submitted by: Aldo MAZZILLI
OperatingSystem: Windows NT
OperatingSystemVersion: Workstation NT4.0
Synopsis: console1 wasn't opened for writing under win32
ReproducibleScript:
if [catch {open "|sh 2>@ stdout" r+} input] {
Error
} else {
fconfigure $input -buffering none
fileevent $input readable Log
}
..
proc Log {} {
global input
if {[gets $input line]<0} {
close $input
} else {
.f.text insert end $line\n
.f.text see end
}
}
PutCmd {} {
puts $input "$cmd \n"
}
ObservedBehavior:
I'm trying to port a TCL script from SUN-OS to Win32 and I have the
following message "console1 wasn't opened for writing" when I 'puts' a
command in a pipeline.
DesiredBehavior:
The pipelined Shell must run the command that the user 'puts' on it and must get everything on stdout and stderr in order to display the both results in a text widget.
Everything works correctly under Sun-OS but fails under win32.
The open "sh 2> ..... " looks suspicious too unless you have a shell
program on Windows - the "shell" (poor though it is) is called cmd.exe
on Windows. It also does not support most unix shell commands and not
even some forms of redirection.
Dave LeBlanc
Thanks a lot for your so quick response but I have to tell you another
thing :
you were right when you say that I may have a shell on Windows.
I forget to tell you that I invoke my TCL script using (for testing)
2 kinds of shell :
- ksh from the MKS Toolkit
- bash from Cygwin32
And none of them give me a right result for "stderr" ("|sh 2>@ stdout").
However, these both two solutions works very well when just reading
stdout ("|sh").
Any other ideas ??
Thanks
--
=======================================================================
,',',',',',',' Aldo MAZZILLI | INRIA Rhone-Alpes |
,',',',',',',' aldo.m...@inrialpes.fr| 655, avenue de l'Europe |
,',',',',',',' Tel : 04 76 61 53 91 | 38330 Montbonnot St Martin |
,',',',',',',' Fax : 04 76 61 52 52 | FRANCE |
,',' *** Site WEB : http://www.inrialpes.fr/vasy/people/Aldo.Mazzilli |
=======================================================================
I use the following on Unix and win32:
set fd [open "|sh -c \"program_name program_args 2>&1\"" r]
and then read away. I use Cygwin on win32, but should work with MKS just
as well.
Regards,
Mumit
There is a program floating around (sorry, don't know where) called
Tee that enables you to capture/redirect stderr on dos or console
apps.
Dave LeBlanc
On Thu, 04 Feb 1999 09:04:45 +0100, Aldo Mazzilli
<aldo.m...@inria.fr> wrote:
>Dave LeBlanc wrote:
>>
>> That message shows up when you're using Wish81.exe on Windows. Windows
>> does not support stdio for GUI apps.
>>
>> The open "sh 2>@ stdout" looks suspicious too unless you have a shell
>> program on Windows - the "shell" (poor though it is) is called cmd.exe
>> on Windows. It also does not support most unix shell commands and not
>> even some forms of redirection.
>>
>
>Thanks a lot for your so quick response but I have to tell you another
>thing :
> you were right when you say that I may have a shell on Windows.
>
>I forget to tell you that I invoke my TCL script using (for testing)
>2 kinds of shell :
>- ksh from the MKS Toolkit
>- bash from Cygwin32
>
>And none of them give me a right result for "stderr" ("|sh 2>@ stdout").
>However, these both two solutions works very well when just reading
>stdout ("|sh").
>
>Any other ideas ??