Features of The Original Version
Features of the UNIX Version 7 Bourne shell include:
- Scripts can be invoked as commands by using their filename
- May be used interactively or non-interactively
- Allow 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, quotation facilities, and functions.
- 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 back quotes:
`command`. - Here documents using
<<to embed a block of input text within a script. - "
for ~ do ~ done" loops, in particular the use of$*to loop over arguments. - "
case ~ in ~ esac" selection mechanism, primarily intended to assist argument parsing. shprovided support for environment variables using keyword parameters and exportable variables.- It contains strong provisions for controlling input and output and in its expression matching facilities.
The Bourne shell also was the first to feature the convention of using file descriptor 2> for error messages, allowing much greater programmatic control during scripting by keeping error messages separate from data.
Stephen Bourne carried into this shell some aspects of the ALGOL 68C compiler that he had been working on at Cambridge University. Notably he reused portions of ALGOL 68's "if ~ then ~ elif ~ else ~ fi", "case ~ in ~ esac" and "for ~ while ~ do ~ od" (using done instead of od) clauses in the common Unix Bourne shell syntax. Moreover – although the v7 shell is written in C – Bourne took advantage of some macros to give the C source code an ALGOL 68 flavor. These macros (along with the finger command distributed in Unix version 4.2BSD) inspired the IOCCC – International Obfuscated C Code Contest.
Read more about this topic: Bourne Shell
Famous quotes containing the words features of the, features of, features, original and/or version:
“Art is the child of Nature; yes,
Her darling child, in whom we trace
The features of the mothers face,
Her aspect and her attitude.”
—Henry Wadsworth Longfellow (18071882)
“These, then, will be some of the features of democracy ... it will be, in all likelihood, an agreeable, lawless, particolored commonwealth, dealing with all alike on a footing of equality, whether they be really equal or not.”
—Plato (c. 427347 B.C.)
“All visible objects, man, are but as pasteboard masks. But in each eventin the living act, the undoubted deedthere, some unknown but still reasoning thing puts forth the mouldings of its features from behind the unreasoning mask. If man will strike, strike through the mask!”
—Herman Melville (18191891)
“It is curious how instinctively one protects the image of oneself from idolatry or any other handling that could make it ridiculous, or too unlike the original to be believed any longer.”
—Virginia Woolf (18821941)
“Truth cannot be defined or tested by agreement with the world; for not only do truths differ for different worlds but the nature of agreement between a world apart from it is notoriously nebulous. Ratherspeaking loosely and without trying to answer either Pilates question or Tarskisa version is to be taken to be true when it offends no unyielding beliefs and none of its own precepts.”
—Nelson Goodman (b. 1906)