GNU Bash Reference Manual

GNU Bash Reference Manual

A definitive reference for GNU Bash, the standard GNU command-line interpreter.

Tag(s): GNU/Linux

Publication date: 01 Jan 2003

ISBN-10: 0954161777

ISBN-13: n/a

Paperback: 180 pages

Views: 33,152

Type: Book

Publisher: Network Theory Ltd

License: GNU Free Documentation License

Post time: 03 Dec 2004 07:10:44

GNU Bash Reference Manual

GNU Bash Reference Manual A definitive reference for GNU Bash, the standard GNU command-line interpreter.
Tag(s): GNU/Linux
Publication date: 01 Jan 2003
ISBN-10: 0954161777
ISBN-13: n/a
Paperback: 180 pages
Views: 33,152
Document Type: Book
Publisher: Network Theory Ltd
License: GNU Free Documentation License
Post time: 03 Dec 2004 07:10:44
Summary/Excerpts of (and not a substitute for) the GNU Free Documentation License:
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". 

Click here to read the full license.
Book excerpts:

Bash is the shell, or command language interpreter, for the GNU operating system. The name is an acronym for the Bourne-Again SHell, a pun on Stephen Bourne, the author of the direct ancestor of the current Unix shell /bin/sh, which appeared in the Seventh Edition Bell Labs Research version of Unix.

Bash is largely compatible with sh and incorporates useful features from the Korn shell ksh and the C shell csh. It is intended to be a conformant implementation of the IEEE POSIX Shell and Tools specification (IEEE Working Group 1003.2). It offers functional improvements over sh for both interactive and programming use.

While the GNU operating system provides other shells, including a version of csh, Bash is the default shell. Like other GNU software, Bash is quite portable. It currently runs on nearly every version of Unix and a few other operating systems - independently-supported ports exist for MS-DOS, OS/2, Windows 95/98, and Windows NT.

At its base, a shell is simply a macro processor that executes commands. A Unix shell is both a command interpreter, which provides the user interface to the rich set of GNU utilities, and a programming language, allowing these utilities to be combined. Files containing commands can be created, and become commands themselves. These new commands have the same status as system commands in directories such as /bin, allowing users or groups to establish custom environments.

A shell allows execution of GNU commands, both synchronously and asynchronously. The shell waits for synchronous commands to complete before accepting more input; asynchronous commands continue to execute in parallel with the shell while it reads and executes additional commands. The redirection constructs permit fine-grained control of the input and output of those commands. Moreover, the shell allows control over the contents of commands' environments. Shells may be used interactively or non-interactively: they accept input typed from the keyboard or from a file.

Shells also provide a small set of built-in commands (builtins) implementing functionality impossible or inconvenient to obtain via separate utilities. For example, cd, break, continue, and exec) cannot be implemented outside of the shell because they directly manipulate the shell itself. The history, getopts, kill, or pwd builtins, among others, could be implemented in separate utilities, but they are more convenient to use as builtin commands. All of the shell builtins are described in subsequent sections.

While executing commands is essential, most of the power (and complexity) of shells is due to their embedded programming languages. Like any high-level language, the shell provides variables, flow control constructs, quoting, and functions.

Shells offer features geared specifically for interactive use rather than to augment the programming language. These interactive features include job control, command line editing, history and aliases. Each of these features is described in this manual.




About The Author(s)


No information is available for this author.

Brian Fox

No information is available for this author.


No information is available for this author.

Chet Ramey

No information is available for this author.


Book Categories
Sponsors