Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
COMMAND.COM
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Redirection, piping, and chaining== Because DOS is a single-tasking operating system, [[Pipeline (software)|piping]] is achieved by running commands sequentially, redirecting to and from a [[temporary file]].{{Citation needed|date=March 2024}} COMMAND.COM makes no provision for redirecting the [[Standard streams#Standard error (stderr)|standard error]] channel.{{Citation needed|date=March 2024}} ; <code>''command'' < ''filename''</code> : Redirect [[Standard streams#Standard input (stdin)|standard input]] from a file or device ; <code>''command'' > ''filename''</code> : Redirect [[Standard streams#Standard output (stdout)|standard output]], overwriting target file if it exists. ; <code>''command'' >> ''filename''</code> : Redirect [[Standard streams#Standard output (stdout)|standard output]], appending to target file if it exists. ; <code>''command1'' | ''command2''</code> : Pipe [[Standard streams#Standard output (stdout)|standard output]] from ''command1'' to [[Standard streams#Standard input (stdin)|standard input]] of ''command2'' ; <code>''command1'' ¶ ''command2''</code> : : Commands separated by ASCII-20 (¶, invoked by {{keypress|Ctrl|T}}) are executed in sequence (chaining of commands).<ref name="Paul_1997_NWDOSTIP"/> In other words, first ''command1'' is executed until termination, then ''command2''.<ref name="Paul_1997_NWDOSTIP"/> This is an undocumented feature in COMMAND.COM of [[MS-DOS 5.0|MS-DOS]]/[[PC DOS 5.0]]<!-- tested MS-DOS 6.2 and PC DOS 7 --> and higher.<ref name="Paul_1997_NWDOSTIP"/> It is also supported by COMMAND.COM<!-- but not by CMD --> of the Windows NT family<!-- tested Windows XP --> as well as by DR-DOS 7.07. All versions of DR-DOS COMMAND.COM<!-- since 3.xx --> already supported a similar internal function utilizing an exclamation mark (!) instead (a feature originally derived from [[Concurrent DOS]] and [[Multiuser DOS]]) - in the single-user line this feature was only available internally (in built-in startup scripts like "!DATE!TIME") and indirectly through [[DOSKEY]]'s $T parameter to avoid problems with ! as a valid filename character.<ref name="Paul_1997_NWDOSTIP"/> [[4DOS]] supports a configurable command line separator ([[4DOS.INI]] CommandSep= or SETDOS /C), which defaults to ^.<ref name="4DOS_8.00_HELP"/> COMMAND.COM in newer versions of Windows NT<!-- works for example in XP, but not in MS-DOS/PC DOS COMMAND.COM --> also supports an {{code|&}} separator for compatibility with the cmd syntax in OS/2 and the Windows NT family.<ref name="4DOS_8.00_HELP"/> (cmd does not support the ¶ separator.)
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
COMMAND.COM
(section)
Add topic