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
Bourne shell
(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!
===Features of the original version=== Features of the Version 7 UNIX Bourne shell include: * Scripts can be invoked as commands by using their filename * May be used interactively or non-interactively * Allows both synchronous and asynchronous execution of commands * Supports input and output redirection and pipelines * Provides a set of built-in commands * Provides flow control constructs and quotation facilities. * Typeless variables * Provides local and global variable scope * Scripts do not require compilation before execution * Does not have a goto facility, so code restructuring may be necessary * [[Command substitution]] using [[backquotes]]: <code>`command`</code>. * [[Here documents]] using <code><<</code> to embed a block of input text within a script. * <code>for ~ do ~ done</code> loops, in particular the use of <code>$*</code> to loop over arguments, as well as <code>for ~ in ~ do ~ done</code> loops for iterating over lists. * <code>case ~ in ~ esac</code> selection mechanism, primarily intended to assist [[argument parsing]]. * <code>sh</code> provided support for environment variables using keyword parameters and exportable variables. * Contains strong provisions for controlling input and output and in its [[regular expression|expression matching]] facilities. The Bourne shell also was the first to feature the convention of using [[file descriptor]] <code>2></code> for [[error message]]s, allowing much greater programmatic control during scripting by keeping error messages separate from data. Stephen Bourne's coding style was influenced by his experience with the [[ALGOL 68C]] compiler<ref name="reader">{{cite tech report |first1=M. D. |last1=McIlroy |author-link1=Doug McIlroy |year=1987 |url=http://www.cs.dartmouth.edu/~doug/reader.pdf |archive-url=https://web.archive.org/web/20140504225225/http://www.cs.dartmouth.edu/~doug/reader.pdf |archive-date=2014-05-04 |url-status=live |title=A Research Unix reader: annotated excerpts from the Programmer's Manual, 1971β1986 |series=CSTR |number=139 |institution=Bell Labs}}</ref> that he had been working on at [[University of Cambridge|Cambridge University]]. In addition to the style in which the program was written, Bourne reused portions of [[ALGOL 68]]'s <code>'''if''' ~ '''then''' ~ '''elif''' ~ '''then''' ~ '''else''' ~ '''fi'''</code>, <code>'''case''' ~ '''in''' ~ '''esac'''</code> and <code>'''for'''/'''while''' ~ '''do''' ~ '''od'''</code>" (using <code>done</code> instead of <code>'''od'''</code>) clauses in the common [[Unix]] Bourne shell syntax. Moreover, β although the v7 shell is written in [[C (programming language)|C]] β Bourne took advantage of some [[Macro (computer science)|macros]]<ref>{{Cite web| url=http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/sh/mac.h|title=mac.h β Macros used by Bourne to structure C like Algol68C |access-date=9 September 2006|author=Bourne, Steve|author-link=Stephen R. Bourne|date= 12 January 1979 |publisher=[[AT&T Corporation]] }}</ref> to give the C [[source code]] an ALGOL 68 flavor. These macros (along with the [[Finger protocol|finger]] command distributed in Unix version [[Berkeley Software Distribution#4.2BSD|4.2BSD]]) inspired the [[International Obfuscated C Code Contest]] (IOCCC).<ref>{{Cite web|url=http://www.ioccc.org/faq.html|title=The IOCCC FAQ β Q/A: How did the IOCCC get started?| access-date=9 September 2006|author=Landon Curt Noll|author-link=Landon Curt Noll|author2=Simon Cooper|author3=Peter Seebach|author4=Leonid A. Broukhis|name-list-style=amp|year= 2004|publisher=ioccc.org}}</ref>
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
Bourne shell
(section)
Add topic