in reply to Re: Generating EOF character on Win98
in thread Generating EOF character on Win98

It works for me even without the final newline.

Another interesting point is that nysus mentioned that pressing CTRL-Z causes the program to terminate immediately where my experience (and current testing) shows that you have to press ENTER after the CTRL-Z for the EOF to be noticed by the program.

I'm not sure where to look next but I'd probably look at the "DOS properties" of the window that the script is running in. Perhaps the CTRL-Z key sequence has been found to some other function? (Though I can't see how even that would explain the stated behavior.)

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: Generating EOF character on Win98

Replies are listed 'Best First'.
Re: (tye)Re: Generating EOF character on Win98
by virtualsue (Vicar) on Jul 23, 2001 at 22:29 UTC
    Oh brother. Now I know why I feel a need to keep a crucifix handy when I work on a PC. On my setup it works the first time I run it (defined as printing 'hello' after ^Z is pressed). Forever after that (well, several times, until I get bored) the 'hello' is not displayed. I have to reboot the PC in order to see 'hello' again. Très weird.

    I have only investigated far enough to note that, as you say, the newline doesn't appear to figure in this at all. It works the first time, and then not again until I restart. Killing the MS-DOS window and starting another one doesn't help.