Computing.Net > Forums > Programming > Bug in cmd? - fourth data stream

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Bug in cmd? - fourth data stream

Reply to Message Icon

Name: Judago
Date: October 15, 2008 at 19:36:11 Pacific
OS: XP home sp3
CPU/Ram: Athlon 64 X2 5600+/gb
Product: Mainboard k9acf-f
Comment:

Does anyone have any info on the fourth data stream(for lack of a better name) for cmd?

I'm using XP home sp3 with all the latest updates and stumbled across something interesting, perhaps even a bug in cmd. The following cmd causes a loop on the command line with the current directory prompt being drawn to screen repeatedly, <ctrl>+<c> doesn't stop it:


cmd<nul 3>nul

Another interesting thing about this is that it doesn't seem to work from a batch unless the batch is invoked from the command line.

By the fourth data stream I mean:

0=standard in
1=standard out
2=standard error
3=?? this one


I did contemplate that it may be some sort of loop back but can't seem to get it to do anything else. Any information is appreciated.



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: October 16, 2008 at 01:44:35 Pacific
Reply:

I don't know the answer, but I found that it doesn't have to be cmd: the command line can invoke any other program. Also, it has to be in the form programname <nul 3>nul. The following will show the bug:

notepad <nul 3>nul
type nul <nul 3>nul

The following will NOT show the bug:

notepad 3>nul <nul
type nul <nul 4>nul

Very strange behaviour.


0

Response Number 2
Name: Judago
Date: October 16, 2008 at 01:55:32 Pacific
Reply:

Yes very strange, I've found other variations as well, nul doesn't have to be involved at all.


cmd<file.txt 3>&1

Another strange thing about it is if you turn echo off first it only displays one prompt as per normal, but there is no control and cmd has high cpu consumption. It "seems" to be using stdout to display the prompts(it will be whatever your prompt is, even custom prompts). So con and stderr don't seem to be involved.....


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


help with awk - sed batch file programming



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Bug in cmd? - fourth data stream

Blank Spaces in cmd www.computing.net/answers/programming/blank-spaces-in-cmd/14095.html

open mulitple (doc) files in cmd www.computing.net/answers/programming/open-mulitple-doc-files-in-cmd/19027.html

redirect findstr output www.computing.net/answers/programming/redirect-findstr-output/20095.html