DOS, create pipe for stdin/stdout of command.com(or 4dos.com) in C or Batch?How does the command.com shell work with MS-DOS?VT52 emulation for MS-DOS?Does ancient UNIX create a new shell process for each terminal?Which tools were used to create the C language?What are these tiny TSRs doing?An old DOS application that allowed to create cards, posters, invitations, etcHow do I create a boot menu to select between Windows and DOS?How do I compile C code with the IRIX X Window System?Gotek drives for MS-DOS (plus few more constraints)Alternatives for TurboVision on DOS
Why has Russell's definition of numbers using equivalence classes been finally abandoned? ( If it has actually been abandoned).
Do Phineas and Ferb ever actually get busted in real time?
Download, install and reboot computer at night if needed
Validation accuracy vs Testing accuracy
Can a German sentence have two subjects?
How to add power-LED to my small amplifier?
New order #4: World
What typically incentivizes a professor to change jobs to a lower ranking university?
Is it possible to make sharp wind that can cut stuff from afar?
How to make payment on the internet without leaving a money trail?
I probably found a bug with the sudo apt install function
Draw simple lines in Inkscape
Is there a familial term for apples and pears?
A Journey Through Space and Time
Set-theoretical foundations of Mathematics with only bounded quantifiers
"which" command doesn't work / path of Safari?
How can the DM most effectively choose 1 out of an odd number of players to be targeted by an attack or effect?
Is there really no realistic way for a skeleton monster to move around without magic?
Infinite past with a beginning?
What do you call a Matrix-like slowdown and camera movement effect?
Why is the design of haulage companies so “special”?
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
How to report a triplet of septets in NMR tabulation?
Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?
DOS, create pipe for stdin/stdout of command.com(or 4dos.com) in C or Batch?
How does the command.com shell work with MS-DOS?VT52 emulation for MS-DOS?Does ancient UNIX create a new shell process for each terminal?Which tools were used to create the C language?What are these tiny TSRs doing?An old DOS application that allowed to create cards, posters, invitations, etcHow do I create a boot menu to select between Windows and DOS?How do I compile C code with the IRIX X Window System?Gotek drives for MS-DOS (plus few more constraints)Alternatives for TurboVision on DOS
I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this?
For instance the pipe() command from unistd.h isn't present in BorlandC, which I'm using.
Can anyone tell me how to to this? Preferably in C or Batch.
Also, how to pipe stdin/out from the current shell (command.com or 4dos.com) in order to "Skin" the console?
ms-dos c shell
New contributor
Dacobi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this?
For instance the pipe() command from unistd.h isn't present in BorlandC, which I'm using.
Can anyone tell me how to to this? Preferably in C or Batch.
Also, how to pipe stdin/out from the current shell (command.com or 4dos.com) in order to "Skin" the console?
ms-dos c shell
New contributor
Dacobi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Are you aware of the Cygwin project ( cygwin.com ) ? It provides Windows the infrastructure compile and run many GNU programs. Included is a terminal program which has many POSIX features. See also: stackoverflow.com/questions/12468913
– RichF
11 hours ago
I know you are working on a retro project, but if working on a modern Windows system there is powershell.exe. I believe it is fully POSIX compatible and comes with the OS. It is obviously not a retro tool, though.
– RichF
10 hours ago
One way to circumvent this, for the skinning part at least, may be the use of a device driver.
– Raffzahn
9 hours ago
@RichF PowerShell is certainly not POSIX-compatible in any way.
– Michael Homer
5 hours ago
@MichaelHomer Sorry. I should have been suspicious of the wording at en.wikipedia.org/wiki/PowerShell It says, "PowerShell's developers based the core grammar of the tool on that of the POSIX 1003.2 Korn shell." I've never actually used it. Thank you for correction. // They have the Command Prompt to be "DOS"; why not make the other shell POSIX?
– RichF
4 hours ago
add a comment |
I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this?
For instance the pipe() command from unistd.h isn't present in BorlandC, which I'm using.
Can anyone tell me how to to this? Preferably in C or Batch.
Also, how to pipe stdin/out from the current shell (command.com or 4dos.com) in order to "Skin" the console?
ms-dos c shell
New contributor
Dacobi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this?
For instance the pipe() command from unistd.h isn't present in BorlandC, which I'm using.
Can anyone tell me how to to this? Preferably in C or Batch.
Also, how to pipe stdin/out from the current shell (command.com or 4dos.com) in order to "Skin" the console?
ms-dos c shell
ms-dos c shell
New contributor
Dacobi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Dacobi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 14 hours ago
Dacobi
New contributor
Dacobi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 14 hours ago
DacobiDacobi
404
404
New contributor
Dacobi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Dacobi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Dacobi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Are you aware of the Cygwin project ( cygwin.com ) ? It provides Windows the infrastructure compile and run many GNU programs. Included is a terminal program which has many POSIX features. See also: stackoverflow.com/questions/12468913
– RichF
11 hours ago
I know you are working on a retro project, but if working on a modern Windows system there is powershell.exe. I believe it is fully POSIX compatible and comes with the OS. It is obviously not a retro tool, though.
– RichF
10 hours ago
One way to circumvent this, for the skinning part at least, may be the use of a device driver.
– Raffzahn
9 hours ago
@RichF PowerShell is certainly not POSIX-compatible in any way.
– Michael Homer
5 hours ago
@MichaelHomer Sorry. I should have been suspicious of the wording at en.wikipedia.org/wiki/PowerShell It says, "PowerShell's developers based the core grammar of the tool on that of the POSIX 1003.2 Korn shell." I've never actually used it. Thank you for correction. // They have the Command Prompt to be "DOS"; why not make the other shell POSIX?
– RichF
4 hours ago
add a comment |
Are you aware of the Cygwin project ( cygwin.com ) ? It provides Windows the infrastructure compile and run many GNU programs. Included is a terminal program which has many POSIX features. See also: stackoverflow.com/questions/12468913
– RichF
11 hours ago
I know you are working on a retro project, but if working on a modern Windows system there is powershell.exe. I believe it is fully POSIX compatible and comes with the OS. It is obviously not a retro tool, though.
– RichF
10 hours ago
One way to circumvent this, for the skinning part at least, may be the use of a device driver.
– Raffzahn
9 hours ago
@RichF PowerShell is certainly not POSIX-compatible in any way.
– Michael Homer
5 hours ago
@MichaelHomer Sorry. I should have been suspicious of the wording at en.wikipedia.org/wiki/PowerShell It says, "PowerShell's developers based the core grammar of the tool on that of the POSIX 1003.2 Korn shell." I've never actually used it. Thank you for correction. // They have the Command Prompt to be "DOS"; why not make the other shell POSIX?
– RichF
4 hours ago
Are you aware of the Cygwin project ( cygwin.com ) ? It provides Windows the infrastructure compile and run many GNU programs. Included is a terminal program which has many POSIX features. See also: stackoverflow.com/questions/12468913
– RichF
11 hours ago
Are you aware of the Cygwin project ( cygwin.com ) ? It provides Windows the infrastructure compile and run many GNU programs. Included is a terminal program which has many POSIX features. See also: stackoverflow.com/questions/12468913
– RichF
11 hours ago
I know you are working on a retro project, but if working on a modern Windows system there is powershell.exe. I believe it is fully POSIX compatible and comes with the OS. It is obviously not a retro tool, though.
– RichF
10 hours ago
I know you are working on a retro project, but if working on a modern Windows system there is powershell.exe. I believe it is fully POSIX compatible and comes with the OS. It is obviously not a retro tool, though.
– RichF
10 hours ago
One way to circumvent this, for the skinning part at least, may be the use of a device driver.
– Raffzahn
9 hours ago
One way to circumvent this, for the skinning part at least, may be the use of a device driver.
– Raffzahn
9 hours ago
@RichF PowerShell is certainly not POSIX-compatible in any way.
– Michael Homer
5 hours ago
@RichF PowerShell is certainly not POSIX-compatible in any way.
– Michael Homer
5 hours ago
@MichaelHomer Sorry. I should have been suspicious of the wording at en.wikipedia.org/wiki/PowerShell It says, "PowerShell's developers based the core grammar of the tool on that of the POSIX 1003.2 Korn shell." I've never actually used it. Thank you for correction. // They have the Command Prompt to be "DOS"; why not make the other shell POSIX?
– RichF
4 hours ago
@MichaelHomer Sorry. I should have been suspicious of the wording at en.wikipedia.org/wiki/PowerShell It says, "PowerShell's developers based the core grammar of the tool on that of the POSIX 1003.2 Korn shell." I've never actually used it. Thank you for correction. // They have the Command Prompt to be "DOS"; why not make the other shell POSIX?
– RichF
4 hours ago
add a comment |
2 Answers
2
active
oldest
votes
MS-DOS doesn't support pipes like Unix does - It does support input and output redirection through its command line processor COMMAND.COM, but that's a different thing.
If you're fine with pure I/O redirection, you should be able to do that using the system() function in C, by providing a command line that has the output redirection (<, >, |) included. Opposed to Unix, you will, however, not be able to have the "piped together" commands run in parallel, but rather only sequentially (which isn't quite what you need to scrape the console of an interactive program) - MS-DOS is not a multitasking system.
Ok. The reason I asked was that I just had a long conversation with a guy on another forum, who said that people used to make CLI overlays to command.com, etc back in the day. But this doesn't seem possible with what you just said.
– Dacobi
14 hours ago
3
Well, you can, with using pure I/O redirection and quite a bit of ado (and people really did that): COMMAND.COM is just (nearly) a program like everything else in MS-DOS. If you do asystem ("COMMAND.COM DIR>C:TMPDIR.TXT")and later parsedir.txt, you might be able to achieve what you are looking for. But you obviously need to implement any command you want to support by a separatesystemcall. And that obviously won't work well with interactive commands.
– tofro
13 hours ago
@Dacobi Since programms can have child programs, these can act as new shell (CLI) for the user and thus replacing Command.com for most parts (or even be started instead) - still, they can't change the nature of the OS. So what's possible or not will be different from what you'd know from a Unix-alike system. Starting with the problem that DOS programs often not write their output STDOUT, but use means of BIOS or direct screen manipulation.
– Raffzahn
10 hours ago
@Dacobi: There were also TSR tools of all kinds that could be used to create "overlays" like Sidekick. Maybe that's what he meant?
– DarkDust
5 hours ago
1
@DarkDust yes. But TSRs wouldn’t exactly fit the concept of pipes. TSRs didn’t have OS mechanisms to communicate to applications
– tofro
5 hours ago
|
show 1 more comment
It seams as if you imply that DOS is kind of an unixoide OS, which it isn't. While Microsoft's goal with MS-DOS 2.0 was to move it toward Unix like operations, for compatibility with Xenix, it never went all the way. Not in internal workings nor API or shell. MS-DOS is a single user, single program OS - with a few 'handmade' exceptions like TSR.
For instance the pipe() command from unistd.h isn't present in BorlandC, which I'm using.
UNISTD is a POSIX definition. DOS isn't a POSIX system. POSIX definitions where made years after DOS got unix alike features.
DOS only implements STDIN/OUT/ERR. They are made as simple file handles (0,1,2) to be read from/writen to and inherited from the parent program.
Can anyone tell me how to to this? Preferably in C or Batch.
Just use redirection one the command line in the usual way via </|/>
Also, how to pipe stdin/out from the current shell (command.com or 4dos.com) in order to "Skin" the console?
You might get a hard time, as DOS can only run a single program at a time. Without two concurrent processes it's just not possible to transfer data between them.
chaining two programs in
Workings of Rediection in DOS
DOS implements pipeing as an application of redirection to files.
When pipeing (redirection to a program) is used, all output of the first program to STDOUT gets written into a temporary file until the program terminates. Then the next program gets started (after the first is unloaded) and the file written is assigned to STDIN (and deleted when this program terminates).
In other words a command line like
TREE C: /F | FIND /I ".COM" | SORT
to display all .COM files with their path on drive C works in sequential steps like this:
TREE C: /F >tempfile1
FIND /I ".COM" <tempfile1 >tempfile2
DEL tempfile1
SORT <tempfile2
DEL tempfile2
From a user perspective the result is the same, but inenr workings are complete different (*1)
So unless you spread your programs across multiple DOS machines, you can't come close to Unix behaviour (*2).
I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this?
See, that's the true lesson of retrocomputing: these old machines and OSes were not the same as today, just in small, slow and with blocky graphics, they where different. And not just between today and back then, but as well between different manufactures and even machines. Backporting ideas isn't about finding the same function, but to work from a complete different angle.
Discovering unknown space with different laws of physic :))
Now, having said all of this and taking the assumption of adding bells and whistles to STDOUT), a clean way to do this would be writing a character driver and assign them as STDIN/OUT when starting command.com. If the driver is (for example) named skinner.dev and the resulting device would be SKINNER, then config.sys needs to contain these two lines (*3):
DEVICE=C:DRIVERSKINNER.DEV
SHELL=C:COMMAND.COM SKINNER
And from there on, all output to STDOUT is delivered thru your driver - unless redirected that is. Now you may add any kind of framing skins or whatsoever. Keep in mind that the application might not be aware of and for example still assume a 24x80 screen, even if you took some characters off for a beautiful frame. Similar any output bypassing STDOUT, like when using BIOS calls or direkt screen manipulation, may show up at the wrong place (*4). Last but not least, every program opening CON on its own will as well bypass your driver.
A few points to think about may be:
Don't forget to make the driver as well handling read requests, as Command.Com requires both ways to go thru the same device.
You may as well try to replace the build-in CON driver(*5), this means setting the CON bit in the device attributes word as well as replacing/capturing INT 29h, as DOS does handle CON a bit different. (*6)
Adding I/O-Control support would support a clean interface to set the workings during runtime (changing colours or whatsoever it does) with a configuration command supplied by you.
Do your users a favour and use Assembly - at least for the driver.
Device drivers can be a lot of fun and are usually way less complicated to write then people tend to assume.
Caveat: Some mechanics only work with DOS 3.1 and higher even though already defined before. This goes especially for monitoring open/close calls.
*1 - Now, when devices are used as targets of a redirection, access is immediate and concurrent. Just they can only be source or destination.
*2 - And even then you may need some file server allowing read while write and plunge in a zillion FLUSH calls to make each output seen.
*3 - For test purpose it may be more appropriate to only load the driver and use redirected STDIN/OUT only via a sub-shell.
*4 - Some of this may be captured by the driver due manipulation of BIOS data and alike - but that will as well lead to a slow creep into machine and OS dependence while at the same time bloating code ever more.
*5 - This would remove some of the possible ways to screw up things for child processes in complex scenarios involving sub-shells as well as redirections with the explicit use of CON. On the down side, you'd have to rewrite all of it's functionality - hopefully compatible with ANSI.SYS which already is one.
*6 - Which BTW would be the better way (when going this route) - get the source for some ANSI.SYS compatible driver like NANSI.SYS and tweek it to support your additional functionality - more work than writing your own, but for sure a great drop in by naming it ANSI.SYS and copying it onto any machine available - not other change needed.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "648"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Dacobi is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f9609%2fdos-create-pipe-for-stdin-stdout-of-command-comor-4dos-com-in-c-or-batch%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
MS-DOS doesn't support pipes like Unix does - It does support input and output redirection through its command line processor COMMAND.COM, but that's a different thing.
If you're fine with pure I/O redirection, you should be able to do that using the system() function in C, by providing a command line that has the output redirection (<, >, |) included. Opposed to Unix, you will, however, not be able to have the "piped together" commands run in parallel, but rather only sequentially (which isn't quite what you need to scrape the console of an interactive program) - MS-DOS is not a multitasking system.
Ok. The reason I asked was that I just had a long conversation with a guy on another forum, who said that people used to make CLI overlays to command.com, etc back in the day. But this doesn't seem possible with what you just said.
– Dacobi
14 hours ago
3
Well, you can, with using pure I/O redirection and quite a bit of ado (and people really did that): COMMAND.COM is just (nearly) a program like everything else in MS-DOS. If you do asystem ("COMMAND.COM DIR>C:TMPDIR.TXT")and later parsedir.txt, you might be able to achieve what you are looking for. But you obviously need to implement any command you want to support by a separatesystemcall. And that obviously won't work well with interactive commands.
– tofro
13 hours ago
@Dacobi Since programms can have child programs, these can act as new shell (CLI) for the user and thus replacing Command.com for most parts (or even be started instead) - still, they can't change the nature of the OS. So what's possible or not will be different from what you'd know from a Unix-alike system. Starting with the problem that DOS programs often not write their output STDOUT, but use means of BIOS or direct screen manipulation.
– Raffzahn
10 hours ago
@Dacobi: There were also TSR tools of all kinds that could be used to create "overlays" like Sidekick. Maybe that's what he meant?
– DarkDust
5 hours ago
1
@DarkDust yes. But TSRs wouldn’t exactly fit the concept of pipes. TSRs didn’t have OS mechanisms to communicate to applications
– tofro
5 hours ago
|
show 1 more comment
MS-DOS doesn't support pipes like Unix does - It does support input and output redirection through its command line processor COMMAND.COM, but that's a different thing.
If you're fine with pure I/O redirection, you should be able to do that using the system() function in C, by providing a command line that has the output redirection (<, >, |) included. Opposed to Unix, you will, however, not be able to have the "piped together" commands run in parallel, but rather only sequentially (which isn't quite what you need to scrape the console of an interactive program) - MS-DOS is not a multitasking system.
Ok. The reason I asked was that I just had a long conversation with a guy on another forum, who said that people used to make CLI overlays to command.com, etc back in the day. But this doesn't seem possible with what you just said.
– Dacobi
14 hours ago
3
Well, you can, with using pure I/O redirection and quite a bit of ado (and people really did that): COMMAND.COM is just (nearly) a program like everything else in MS-DOS. If you do asystem ("COMMAND.COM DIR>C:TMPDIR.TXT")and later parsedir.txt, you might be able to achieve what you are looking for. But you obviously need to implement any command you want to support by a separatesystemcall. And that obviously won't work well with interactive commands.
– tofro
13 hours ago
@Dacobi Since programms can have child programs, these can act as new shell (CLI) for the user and thus replacing Command.com for most parts (or even be started instead) - still, they can't change the nature of the OS. So what's possible or not will be different from what you'd know from a Unix-alike system. Starting with the problem that DOS programs often not write their output STDOUT, but use means of BIOS or direct screen manipulation.
– Raffzahn
10 hours ago
@Dacobi: There were also TSR tools of all kinds that could be used to create "overlays" like Sidekick. Maybe that's what he meant?
– DarkDust
5 hours ago
1
@DarkDust yes. But TSRs wouldn’t exactly fit the concept of pipes. TSRs didn’t have OS mechanisms to communicate to applications
– tofro
5 hours ago
|
show 1 more comment
MS-DOS doesn't support pipes like Unix does - It does support input and output redirection through its command line processor COMMAND.COM, but that's a different thing.
If you're fine with pure I/O redirection, you should be able to do that using the system() function in C, by providing a command line that has the output redirection (<, >, |) included. Opposed to Unix, you will, however, not be able to have the "piped together" commands run in parallel, but rather only sequentially (which isn't quite what you need to scrape the console of an interactive program) - MS-DOS is not a multitasking system.
MS-DOS doesn't support pipes like Unix does - It does support input and output redirection through its command line processor COMMAND.COM, but that's a different thing.
If you're fine with pure I/O redirection, you should be able to do that using the system() function in C, by providing a command line that has the output redirection (<, >, |) included. Opposed to Unix, you will, however, not be able to have the "piped together" commands run in parallel, but rather only sequentially (which isn't quite what you need to scrape the console of an interactive program) - MS-DOS is not a multitasking system.
edited 13 hours ago
answered 14 hours ago
tofrotofro
16.5k33493
16.5k33493
Ok. The reason I asked was that I just had a long conversation with a guy on another forum, who said that people used to make CLI overlays to command.com, etc back in the day. But this doesn't seem possible with what you just said.
– Dacobi
14 hours ago
3
Well, you can, with using pure I/O redirection and quite a bit of ado (and people really did that): COMMAND.COM is just (nearly) a program like everything else in MS-DOS. If you do asystem ("COMMAND.COM DIR>C:TMPDIR.TXT")and later parsedir.txt, you might be able to achieve what you are looking for. But you obviously need to implement any command you want to support by a separatesystemcall. And that obviously won't work well with interactive commands.
– tofro
13 hours ago
@Dacobi Since programms can have child programs, these can act as new shell (CLI) for the user and thus replacing Command.com for most parts (or even be started instead) - still, they can't change the nature of the OS. So what's possible or not will be different from what you'd know from a Unix-alike system. Starting with the problem that DOS programs often not write their output STDOUT, but use means of BIOS or direct screen manipulation.
– Raffzahn
10 hours ago
@Dacobi: There were also TSR tools of all kinds that could be used to create "overlays" like Sidekick. Maybe that's what he meant?
– DarkDust
5 hours ago
1
@DarkDust yes. But TSRs wouldn’t exactly fit the concept of pipes. TSRs didn’t have OS mechanisms to communicate to applications
– tofro
5 hours ago
|
show 1 more comment
Ok. The reason I asked was that I just had a long conversation with a guy on another forum, who said that people used to make CLI overlays to command.com, etc back in the day. But this doesn't seem possible with what you just said.
– Dacobi
14 hours ago
3
Well, you can, with using pure I/O redirection and quite a bit of ado (and people really did that): COMMAND.COM is just (nearly) a program like everything else in MS-DOS. If you do asystem ("COMMAND.COM DIR>C:TMPDIR.TXT")and later parsedir.txt, you might be able to achieve what you are looking for. But you obviously need to implement any command you want to support by a separatesystemcall. And that obviously won't work well with interactive commands.
– tofro
13 hours ago
@Dacobi Since programms can have child programs, these can act as new shell (CLI) for the user and thus replacing Command.com for most parts (or even be started instead) - still, they can't change the nature of the OS. So what's possible or not will be different from what you'd know from a Unix-alike system. Starting with the problem that DOS programs often not write their output STDOUT, but use means of BIOS or direct screen manipulation.
– Raffzahn
10 hours ago
@Dacobi: There were also TSR tools of all kinds that could be used to create "overlays" like Sidekick. Maybe that's what he meant?
– DarkDust
5 hours ago
1
@DarkDust yes. But TSRs wouldn’t exactly fit the concept of pipes. TSRs didn’t have OS mechanisms to communicate to applications
– tofro
5 hours ago
Ok. The reason I asked was that I just had a long conversation with a guy on another forum, who said that people used to make CLI overlays to command.com, etc back in the day. But this doesn't seem possible with what you just said.
– Dacobi
14 hours ago
Ok. The reason I asked was that I just had a long conversation with a guy on another forum, who said that people used to make CLI overlays to command.com, etc back in the day. But this doesn't seem possible with what you just said.
– Dacobi
14 hours ago
3
3
Well, you can, with using pure I/O redirection and quite a bit of ado (and people really did that): COMMAND.COM is just (nearly) a program like everything else in MS-DOS. If you do a
system ("COMMAND.COM DIR>C:TMPDIR.TXT") and later parse dir.txt, you might be able to achieve what you are looking for. But you obviously need to implement any command you want to support by a separate system call. And that obviously won't work well with interactive commands.– tofro
13 hours ago
Well, you can, with using pure I/O redirection and quite a bit of ado (and people really did that): COMMAND.COM is just (nearly) a program like everything else in MS-DOS. If you do a
system ("COMMAND.COM DIR>C:TMPDIR.TXT") and later parse dir.txt, you might be able to achieve what you are looking for. But you obviously need to implement any command you want to support by a separate system call. And that obviously won't work well with interactive commands.– tofro
13 hours ago
@Dacobi Since programms can have child programs, these can act as new shell (CLI) for the user and thus replacing Command.com for most parts (or even be started instead) - still, they can't change the nature of the OS. So what's possible or not will be different from what you'd know from a Unix-alike system. Starting with the problem that DOS programs often not write their output STDOUT, but use means of BIOS or direct screen manipulation.
– Raffzahn
10 hours ago
@Dacobi Since programms can have child programs, these can act as new shell (CLI) for the user and thus replacing Command.com for most parts (or even be started instead) - still, they can't change the nature of the OS. So what's possible or not will be different from what you'd know from a Unix-alike system. Starting with the problem that DOS programs often not write their output STDOUT, but use means of BIOS or direct screen manipulation.
– Raffzahn
10 hours ago
@Dacobi: There were also TSR tools of all kinds that could be used to create "overlays" like Sidekick. Maybe that's what he meant?
– DarkDust
5 hours ago
@Dacobi: There were also TSR tools of all kinds that could be used to create "overlays" like Sidekick. Maybe that's what he meant?
– DarkDust
5 hours ago
1
1
@DarkDust yes. But TSRs wouldn’t exactly fit the concept of pipes. TSRs didn’t have OS mechanisms to communicate to applications
– tofro
5 hours ago
@DarkDust yes. But TSRs wouldn’t exactly fit the concept of pipes. TSRs didn’t have OS mechanisms to communicate to applications
– tofro
5 hours ago
|
show 1 more comment
It seams as if you imply that DOS is kind of an unixoide OS, which it isn't. While Microsoft's goal with MS-DOS 2.0 was to move it toward Unix like operations, for compatibility with Xenix, it never went all the way. Not in internal workings nor API or shell. MS-DOS is a single user, single program OS - with a few 'handmade' exceptions like TSR.
For instance the pipe() command from unistd.h isn't present in BorlandC, which I'm using.
UNISTD is a POSIX definition. DOS isn't a POSIX system. POSIX definitions where made years after DOS got unix alike features.
DOS only implements STDIN/OUT/ERR. They are made as simple file handles (0,1,2) to be read from/writen to and inherited from the parent program.
Can anyone tell me how to to this? Preferably in C or Batch.
Just use redirection one the command line in the usual way via </|/>
Also, how to pipe stdin/out from the current shell (command.com or 4dos.com) in order to "Skin" the console?
You might get a hard time, as DOS can only run a single program at a time. Without two concurrent processes it's just not possible to transfer data between them.
chaining two programs in
Workings of Rediection in DOS
DOS implements pipeing as an application of redirection to files.
When pipeing (redirection to a program) is used, all output of the first program to STDOUT gets written into a temporary file until the program terminates. Then the next program gets started (after the first is unloaded) and the file written is assigned to STDIN (and deleted when this program terminates).
In other words a command line like
TREE C: /F | FIND /I ".COM" | SORT
to display all .COM files with their path on drive C works in sequential steps like this:
TREE C: /F >tempfile1
FIND /I ".COM" <tempfile1 >tempfile2
DEL tempfile1
SORT <tempfile2
DEL tempfile2
From a user perspective the result is the same, but inenr workings are complete different (*1)
So unless you spread your programs across multiple DOS machines, you can't come close to Unix behaviour (*2).
I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this?
See, that's the true lesson of retrocomputing: these old machines and OSes were not the same as today, just in small, slow and with blocky graphics, they where different. And not just between today and back then, but as well between different manufactures and even machines. Backporting ideas isn't about finding the same function, but to work from a complete different angle.
Discovering unknown space with different laws of physic :))
Now, having said all of this and taking the assumption of adding bells and whistles to STDOUT), a clean way to do this would be writing a character driver and assign them as STDIN/OUT when starting command.com. If the driver is (for example) named skinner.dev and the resulting device would be SKINNER, then config.sys needs to contain these two lines (*3):
DEVICE=C:DRIVERSKINNER.DEV
SHELL=C:COMMAND.COM SKINNER
And from there on, all output to STDOUT is delivered thru your driver - unless redirected that is. Now you may add any kind of framing skins or whatsoever. Keep in mind that the application might not be aware of and for example still assume a 24x80 screen, even if you took some characters off for a beautiful frame. Similar any output bypassing STDOUT, like when using BIOS calls or direkt screen manipulation, may show up at the wrong place (*4). Last but not least, every program opening CON on its own will as well bypass your driver.
A few points to think about may be:
Don't forget to make the driver as well handling read requests, as Command.Com requires both ways to go thru the same device.
You may as well try to replace the build-in CON driver(*5), this means setting the CON bit in the device attributes word as well as replacing/capturing INT 29h, as DOS does handle CON a bit different. (*6)
Adding I/O-Control support would support a clean interface to set the workings during runtime (changing colours or whatsoever it does) with a configuration command supplied by you.
Do your users a favour and use Assembly - at least for the driver.
Device drivers can be a lot of fun and are usually way less complicated to write then people tend to assume.
Caveat: Some mechanics only work with DOS 3.1 and higher even though already defined before. This goes especially for monitoring open/close calls.
*1 - Now, when devices are used as targets of a redirection, access is immediate and concurrent. Just they can only be source or destination.
*2 - And even then you may need some file server allowing read while write and plunge in a zillion FLUSH calls to make each output seen.
*3 - For test purpose it may be more appropriate to only load the driver and use redirected STDIN/OUT only via a sub-shell.
*4 - Some of this may be captured by the driver due manipulation of BIOS data and alike - but that will as well lead to a slow creep into machine and OS dependence while at the same time bloating code ever more.
*5 - This would remove some of the possible ways to screw up things for child processes in complex scenarios involving sub-shells as well as redirections with the explicit use of CON. On the down side, you'd have to rewrite all of it's functionality - hopefully compatible with ANSI.SYS which already is one.
*6 - Which BTW would be the better way (when going this route) - get the source for some ANSI.SYS compatible driver like NANSI.SYS and tweek it to support your additional functionality - more work than writing your own, but for sure a great drop in by naming it ANSI.SYS and copying it onto any machine available - not other change needed.
add a comment |
It seams as if you imply that DOS is kind of an unixoide OS, which it isn't. While Microsoft's goal with MS-DOS 2.0 was to move it toward Unix like operations, for compatibility with Xenix, it never went all the way. Not in internal workings nor API or shell. MS-DOS is a single user, single program OS - with a few 'handmade' exceptions like TSR.
For instance the pipe() command from unistd.h isn't present in BorlandC, which I'm using.
UNISTD is a POSIX definition. DOS isn't a POSIX system. POSIX definitions where made years after DOS got unix alike features.
DOS only implements STDIN/OUT/ERR. They are made as simple file handles (0,1,2) to be read from/writen to and inherited from the parent program.
Can anyone tell me how to to this? Preferably in C or Batch.
Just use redirection one the command line in the usual way via </|/>
Also, how to pipe stdin/out from the current shell (command.com or 4dos.com) in order to "Skin" the console?
You might get a hard time, as DOS can only run a single program at a time. Without two concurrent processes it's just not possible to transfer data between them.
chaining two programs in
Workings of Rediection in DOS
DOS implements pipeing as an application of redirection to files.
When pipeing (redirection to a program) is used, all output of the first program to STDOUT gets written into a temporary file until the program terminates. Then the next program gets started (after the first is unloaded) and the file written is assigned to STDIN (and deleted when this program terminates).
In other words a command line like
TREE C: /F | FIND /I ".COM" | SORT
to display all .COM files with their path on drive C works in sequential steps like this:
TREE C: /F >tempfile1
FIND /I ".COM" <tempfile1 >tempfile2
DEL tempfile1
SORT <tempfile2
DEL tempfile2
From a user perspective the result is the same, but inenr workings are complete different (*1)
So unless you spread your programs across multiple DOS machines, you can't come close to Unix behaviour (*2).
I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this?
See, that's the true lesson of retrocomputing: these old machines and OSes were not the same as today, just in small, slow and with blocky graphics, they where different. And not just between today and back then, but as well between different manufactures and even machines. Backporting ideas isn't about finding the same function, but to work from a complete different angle.
Discovering unknown space with different laws of physic :))
Now, having said all of this and taking the assumption of adding bells and whistles to STDOUT), a clean way to do this would be writing a character driver and assign them as STDIN/OUT when starting command.com. If the driver is (for example) named skinner.dev and the resulting device would be SKINNER, then config.sys needs to contain these two lines (*3):
DEVICE=C:DRIVERSKINNER.DEV
SHELL=C:COMMAND.COM SKINNER
And from there on, all output to STDOUT is delivered thru your driver - unless redirected that is. Now you may add any kind of framing skins or whatsoever. Keep in mind that the application might not be aware of and for example still assume a 24x80 screen, even if you took some characters off for a beautiful frame. Similar any output bypassing STDOUT, like when using BIOS calls or direkt screen manipulation, may show up at the wrong place (*4). Last but not least, every program opening CON on its own will as well bypass your driver.
A few points to think about may be:
Don't forget to make the driver as well handling read requests, as Command.Com requires both ways to go thru the same device.
You may as well try to replace the build-in CON driver(*5), this means setting the CON bit in the device attributes word as well as replacing/capturing INT 29h, as DOS does handle CON a bit different. (*6)
Adding I/O-Control support would support a clean interface to set the workings during runtime (changing colours or whatsoever it does) with a configuration command supplied by you.
Do your users a favour and use Assembly - at least for the driver.
Device drivers can be a lot of fun and are usually way less complicated to write then people tend to assume.
Caveat: Some mechanics only work with DOS 3.1 and higher even though already defined before. This goes especially for monitoring open/close calls.
*1 - Now, when devices are used as targets of a redirection, access is immediate and concurrent. Just they can only be source or destination.
*2 - And even then you may need some file server allowing read while write and plunge in a zillion FLUSH calls to make each output seen.
*3 - For test purpose it may be more appropriate to only load the driver and use redirected STDIN/OUT only via a sub-shell.
*4 - Some of this may be captured by the driver due manipulation of BIOS data and alike - but that will as well lead to a slow creep into machine and OS dependence while at the same time bloating code ever more.
*5 - This would remove some of the possible ways to screw up things for child processes in complex scenarios involving sub-shells as well as redirections with the explicit use of CON. On the down side, you'd have to rewrite all of it's functionality - hopefully compatible with ANSI.SYS which already is one.
*6 - Which BTW would be the better way (when going this route) - get the source for some ANSI.SYS compatible driver like NANSI.SYS and tweek it to support your additional functionality - more work than writing your own, but for sure a great drop in by naming it ANSI.SYS and copying it onto any machine available - not other change needed.
add a comment |
It seams as if you imply that DOS is kind of an unixoide OS, which it isn't. While Microsoft's goal with MS-DOS 2.0 was to move it toward Unix like operations, for compatibility with Xenix, it never went all the way. Not in internal workings nor API or shell. MS-DOS is a single user, single program OS - with a few 'handmade' exceptions like TSR.
For instance the pipe() command from unistd.h isn't present in BorlandC, which I'm using.
UNISTD is a POSIX definition. DOS isn't a POSIX system. POSIX definitions where made years after DOS got unix alike features.
DOS only implements STDIN/OUT/ERR. They are made as simple file handles (0,1,2) to be read from/writen to and inherited from the parent program.
Can anyone tell me how to to this? Preferably in C or Batch.
Just use redirection one the command line in the usual way via </|/>
Also, how to pipe stdin/out from the current shell (command.com or 4dos.com) in order to "Skin" the console?
You might get a hard time, as DOS can only run a single program at a time. Without two concurrent processes it's just not possible to transfer data between them.
chaining two programs in
Workings of Rediection in DOS
DOS implements pipeing as an application of redirection to files.
When pipeing (redirection to a program) is used, all output of the first program to STDOUT gets written into a temporary file until the program terminates. Then the next program gets started (after the first is unloaded) and the file written is assigned to STDIN (and deleted when this program terminates).
In other words a command line like
TREE C: /F | FIND /I ".COM" | SORT
to display all .COM files with their path on drive C works in sequential steps like this:
TREE C: /F >tempfile1
FIND /I ".COM" <tempfile1 >tempfile2
DEL tempfile1
SORT <tempfile2
DEL tempfile2
From a user perspective the result is the same, but inenr workings are complete different (*1)
So unless you spread your programs across multiple DOS machines, you can't come close to Unix behaviour (*2).
I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this?
See, that's the true lesson of retrocomputing: these old machines and OSes were not the same as today, just in small, slow and with blocky graphics, they where different. And not just between today and back then, but as well between different manufactures and even machines. Backporting ideas isn't about finding the same function, but to work from a complete different angle.
Discovering unknown space with different laws of physic :))
Now, having said all of this and taking the assumption of adding bells and whistles to STDOUT), a clean way to do this would be writing a character driver and assign them as STDIN/OUT when starting command.com. If the driver is (for example) named skinner.dev and the resulting device would be SKINNER, then config.sys needs to contain these two lines (*3):
DEVICE=C:DRIVERSKINNER.DEV
SHELL=C:COMMAND.COM SKINNER
And from there on, all output to STDOUT is delivered thru your driver - unless redirected that is. Now you may add any kind of framing skins or whatsoever. Keep in mind that the application might not be aware of and for example still assume a 24x80 screen, even if you took some characters off for a beautiful frame. Similar any output bypassing STDOUT, like when using BIOS calls or direkt screen manipulation, may show up at the wrong place (*4). Last but not least, every program opening CON on its own will as well bypass your driver.
A few points to think about may be:
Don't forget to make the driver as well handling read requests, as Command.Com requires both ways to go thru the same device.
You may as well try to replace the build-in CON driver(*5), this means setting the CON bit in the device attributes word as well as replacing/capturing INT 29h, as DOS does handle CON a bit different. (*6)
Adding I/O-Control support would support a clean interface to set the workings during runtime (changing colours or whatsoever it does) with a configuration command supplied by you.
Do your users a favour and use Assembly - at least for the driver.
Device drivers can be a lot of fun and are usually way less complicated to write then people tend to assume.
Caveat: Some mechanics only work with DOS 3.1 and higher even though already defined before. This goes especially for monitoring open/close calls.
*1 - Now, when devices are used as targets of a redirection, access is immediate and concurrent. Just they can only be source or destination.
*2 - And even then you may need some file server allowing read while write and plunge in a zillion FLUSH calls to make each output seen.
*3 - For test purpose it may be more appropriate to only load the driver and use redirected STDIN/OUT only via a sub-shell.
*4 - Some of this may be captured by the driver due manipulation of BIOS data and alike - but that will as well lead to a slow creep into machine and OS dependence while at the same time bloating code ever more.
*5 - This would remove some of the possible ways to screw up things for child processes in complex scenarios involving sub-shells as well as redirections with the explicit use of CON. On the down side, you'd have to rewrite all of it's functionality - hopefully compatible with ANSI.SYS which already is one.
*6 - Which BTW would be the better way (when going this route) - get the source for some ANSI.SYS compatible driver like NANSI.SYS and tweek it to support your additional functionality - more work than writing your own, but for sure a great drop in by naming it ANSI.SYS and copying it onto any machine available - not other change needed.
It seams as if you imply that DOS is kind of an unixoide OS, which it isn't. While Microsoft's goal with MS-DOS 2.0 was to move it toward Unix like operations, for compatibility with Xenix, it never went all the way. Not in internal workings nor API or shell. MS-DOS is a single user, single program OS - with a few 'handmade' exceptions like TSR.
For instance the pipe() command from unistd.h isn't present in BorlandC, which I'm using.
UNISTD is a POSIX definition. DOS isn't a POSIX system. POSIX definitions where made years after DOS got unix alike features.
DOS only implements STDIN/OUT/ERR. They are made as simple file handles (0,1,2) to be read from/writen to and inherited from the parent program.
Can anyone tell me how to to this? Preferably in C or Batch.
Just use redirection one the command line in the usual way via </|/>
Also, how to pipe stdin/out from the current shell (command.com or 4dos.com) in order to "Skin" the console?
You might get a hard time, as DOS can only run a single program at a time. Without two concurrent processes it's just not possible to transfer data between them.
chaining two programs in
Workings of Rediection in DOS
DOS implements pipeing as an application of redirection to files.
When pipeing (redirection to a program) is used, all output of the first program to STDOUT gets written into a temporary file until the program terminates. Then the next program gets started (after the first is unloaded) and the file written is assigned to STDIN (and deleted when this program terminates).
In other words a command line like
TREE C: /F | FIND /I ".COM" | SORT
to display all .COM files with their path on drive C works in sequential steps like this:
TREE C: /F >tempfile1
FIND /I ".COM" <tempfile1 >tempfile2
DEL tempfile1
SORT <tempfile2
DEL tempfile2
From a user perspective the result is the same, but inenr workings are complete different (*1)
So unless you spread your programs across multiple DOS machines, you can't come close to Unix behaviour (*2).
I'm working on a retro project and was trying to create a pipe of stdin/out/err in DOS, but I can't find any functions to to this?
See, that's the true lesson of retrocomputing: these old machines and OSes were not the same as today, just in small, slow and with blocky graphics, they where different. And not just between today and back then, but as well between different manufactures and even machines. Backporting ideas isn't about finding the same function, but to work from a complete different angle.
Discovering unknown space with different laws of physic :))
Now, having said all of this and taking the assumption of adding bells and whistles to STDOUT), a clean way to do this would be writing a character driver and assign them as STDIN/OUT when starting command.com. If the driver is (for example) named skinner.dev and the resulting device would be SKINNER, then config.sys needs to contain these two lines (*3):
DEVICE=C:DRIVERSKINNER.DEV
SHELL=C:COMMAND.COM SKINNER
And from there on, all output to STDOUT is delivered thru your driver - unless redirected that is. Now you may add any kind of framing skins or whatsoever. Keep in mind that the application might not be aware of and for example still assume a 24x80 screen, even if you took some characters off for a beautiful frame. Similar any output bypassing STDOUT, like when using BIOS calls or direkt screen manipulation, may show up at the wrong place (*4). Last but not least, every program opening CON on its own will as well bypass your driver.
A few points to think about may be:
Don't forget to make the driver as well handling read requests, as Command.Com requires both ways to go thru the same device.
You may as well try to replace the build-in CON driver(*5), this means setting the CON bit in the device attributes word as well as replacing/capturing INT 29h, as DOS does handle CON a bit different. (*6)
Adding I/O-Control support would support a clean interface to set the workings during runtime (changing colours or whatsoever it does) with a configuration command supplied by you.
Do your users a favour and use Assembly - at least for the driver.
Device drivers can be a lot of fun and are usually way less complicated to write then people tend to assume.
Caveat: Some mechanics only work with DOS 3.1 and higher even though already defined before. This goes especially for monitoring open/close calls.
*1 - Now, when devices are used as targets of a redirection, access is immediate and concurrent. Just they can only be source or destination.
*2 - And even then you may need some file server allowing read while write and plunge in a zillion FLUSH calls to make each output seen.
*3 - For test purpose it may be more appropriate to only load the driver and use redirected STDIN/OUT only via a sub-shell.
*4 - Some of this may be captured by the driver due manipulation of BIOS data and alike - but that will as well lead to a slow creep into machine and OS dependence while at the same time bloating code ever more.
*5 - This would remove some of the possible ways to screw up things for child processes in complex scenarios involving sub-shells as well as redirections with the explicit use of CON. On the down side, you'd have to rewrite all of it's functionality - hopefully compatible with ANSI.SYS which already is one.
*6 - Which BTW would be the better way (when going this route) - get the source for some ANSI.SYS compatible driver like NANSI.SYS and tweek it to support your additional functionality - more work than writing your own, but for sure a great drop in by naming it ANSI.SYS and copying it onto any machine available - not other change needed.
edited 3 hours ago
answered 14 hours ago
RaffzahnRaffzahn
55.6k6136224
55.6k6136224
add a comment |
add a comment |
Dacobi is a new contributor. Be nice, and check out our Code of Conduct.
Dacobi is a new contributor. Be nice, and check out our Code of Conduct.
Dacobi is a new contributor. Be nice, and check out our Code of Conduct.
Dacobi is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Retrocomputing Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f9609%2fdos-create-pipe-for-stdin-stdout-of-command-comor-4dos-com-in-c-or-batch%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you aware of the Cygwin project ( cygwin.com ) ? It provides Windows the infrastructure compile and run many GNU programs. Included is a terminal program which has many POSIX features. See also: stackoverflow.com/questions/12468913
– RichF
11 hours ago
I know you are working on a retro project, but if working on a modern Windows system there is powershell.exe. I believe it is fully POSIX compatible and comes with the OS. It is obviously not a retro tool, though.
– RichF
10 hours ago
One way to circumvent this, for the skinning part at least, may be the use of a device driver.
– Raffzahn
9 hours ago
@RichF PowerShell is certainly not POSIX-compatible in any way.
– Michael Homer
5 hours ago
@MichaelHomer Sorry. I should have been suspicious of the wording at en.wikipedia.org/wiki/PowerShell It says, "PowerShell's developers based the core grammar of the tool on that of the POSIX 1003.2 Korn shell." I've never actually used it. Thank you for correction. // They have the Command Prompt to be "DOS"; why not make the other shell POSIX?
– RichF
4 hours ago