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
Thompson shell
(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!
==History== The name "shell" for a [[Command-line interface#Command-line interpreter|command-line interpreter]] and the concept of making the shell a user program outside of the operating system [[Kernel (operating system)|kernel]] were introduced in Unix's precursor [[Multics]]. An early feature of the Thompson shell was a compact syntax for input/output [[Redirection (computing)|redirection]]. In Multics, redirecting the input or output of a command required separate commands to start and stop redirection; in Unix, one could simply add an argument to the command line consisting of the < symbol followed by a filename for input or the > symbol for output, and the shell would redirect I/O for the duration of the command. This syntax was already present by the release of the first version of Unix in 1971. A later addition was the concept of [[pipeline (Unix)|pipes]]. At the suggestion of [[Douglas McIlroy]], the redirection syntax was expanded so that the output of one command could be passed to the input of another command. The original pipe syntax, as described in the Version 3 manual, was: command1 >command2> This syntax proved too ambiguous and was easily confused with redirection to files—the system cannot tell whether "command2" is a command or a file.{{Citation needed|reason=this statement makes no sense. Ken Thompson was no novice programmer. The syntax must have been sufficiently clear to the interpreter. The syntax shown *does* look unambiguous (but hard to read for humans). More likely, it was confusing for users. A citation will settle this.|date=November 2024}} By Version 4, the syntax had changed to use both the | and ^ symbols to denote pipes: command1 | command2 This produces exactly the same result as: command1 ^ command2 The > symbol changed into: command1 > file1 This would put the output of command1 into file1. The Thompson shell syntax for redirection with < and >, and piping with |, has proven durable and has been adopted by most other Unix shells and command shells of several other operating systems, most notably on [[DOS]], [[OS/2]] and [[Microsoft Windows]].
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)