From: elowe@delta.net (Elliott A. Lowe)
Subject: Re: bash-shell output
4 Feb 1998 21:56:00 -0800
Message-ID: <01bd31e4$50f3ee70$28bfabc7.cygnus.gnu-win32@cretin.DELTANET>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
To: <gnu-win32@cygnus.com>, "Nils Goesche" <ngo@wossolit.teles.de>
Cc: <ntemacs-users@cs.washington.edu>

Bash is actually behaving correctly; your printf() call would do the same
thing on Unix.  Since stdout is by default fully line-buffered, any text
that isn't terminated with a newline must be flushed before it will show up.

The way I get around this is to write the prompt to stderr using fprintf(),
since stderr is by default unbuffered.

Elliott

-----Original Message-----
From: Nils Goesche <ngo@wossolit.teles.de>
To: gnu-win32@cygnus.com <gnu-win32@cygnus.com>
Cc: ntemacs-users@cs.washington.edu <ntemacs-users@cs.washington.edu>
Date: Wednesday, February 04, 1998 4:11 PM
Subject: bash-shell output


>Hi!
>
>The following program doesn't work properly when run from bash
>(with `M-x shell' from within Emacs):
>
>#include <stdio.h>
>
>int main()
>{
> int i;
>
> printf("Enter number: ");
> /* fflush(NULL); */
> scanf("%d", &i);
> printf("Got %d.\n", i);
> return 0;
>}
>
>You have to uncomment that fflush-line. But the usual shells
>like command.com or 4nt don't need that line. This is somewhat
>annoying. Can I at least force the shell somehow to flush
>input/output buffers? Some other programs are just unusable
>because of this behavior.
>
>--
>Nils Goesche
>My obscure opinions are my very own.
>

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
