
| Execution method: | Interpreted |
|---|---|
| Lang tag(s): | bash |
| See Also: |
TheUNIX Shell is a component of terminal-basedUNIX-derived systems which offers both a command-line interface for running system commands, as well as programming interface for intelligently automating tasks which use system commands.
There are many UNIX Shells and most of them can be categorized into two families. For purposes of the Rosetta Code, all examples are in Bourne-compatible syntax. The other family of shells, with a markedly different syntax, arecsh (C Shell) and itstcsh (Tenex C Shell) "clone." Common Bourne compatible shells include the originalBourne Shell (/bin/sh on most versions of UNIX), the GNUBourne Again SHell (bash --- which is linked to/bin/sh on many distributions ofLinux, making it their default shell), theKorn Shell (ksh), thePublic Domain Korn SHell (pdksh), theAlmquist SHell (ash) and theDebian Almquist SHell (dash) and theZ SHell (zsh).
Main article:UNIX Shell Implementations
While UNIX Shells vary in the programming languages they support, such languages carry a minimum set of features. Each language allows the programmer toexecute system commands as though he were typing the commands himself, and each language allows for a header line which specifies which shell implementation is used to interpret the script.
This one tells the operating system to use theBourne Shell:
#!/bin/sh
This line tells the operating system to use theBourne Again SHell:
#!/bin/bash
And this one tells the operating system to use theKorn Shell:
#!/bin/ksh
Each header line consists of a hash, a bang, and the path to theinterpreter binary.
This category has the following 5 subcategories, out of 5 total.
The following 200 pages are in this category, out of 364 total.
(previous page) (next page)