Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
COMMAND.COM
(section)
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.)
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)