Bash Reference Manual

[Top] [Contents] [Index] [ ? ]

Bash Reference Manual

This text is a brief description of the features that are present in the Bash shell.

This is Edition 2.5b, last updated 15 July 2002, of The GNU Bash Reference Manual, for Bash, Version 2.05b.

Copyright (C) 1991-2002 Free Software Foundation, Inc.

Bash contains features that appear in other popular shells, and some features that only appear in Bash. Some of the shells that Bash has borrowed concepts from are the Bourne Shell (`sh'), the Korn Shell (`ksh'), and the C-shell (`csh' and its successor, `tcsh'). The following menu breaks the features up into categories based upon which one of these other shells inspired the feature.

This manual is meant as a brief introduction to features found in Bash. The Bash manual page should be used as the definitive reference on shell behavior.


1. Introduction An introduction to the shell.

2. Definitions Some definitions used in the rest of this manual.

3. Basic Shell Features The shell "building blocks".

4. Shell Builtin Commands Commands that are a part of the shell.

5. Shell Variables Variables used or set by Bash.

6. Bash Features Features found only in Bash.

7. Job Control A chapter describing what job control is and how Bash allows you to use it.

8. Command Line Editing Chapter describing the command line editing features.

9. Using History Interactively Chapter dealing with history expansion rules.

10. Installing Bash How to build and install Bash on your system.

A. Reporting Bugs How to report bugs in Bash.

B. Major Differences From The Bourne Shell A terse list of the differences between Bash and historical versions of /bin/sh.

Index of Shell Builtin Commands Index of Bash builtin commands.

Index of Shell Reserved Words Index of Bash reserved words.

Parameter and Variable Index Quick reference helps you find the variable you want.

Function Index Index of bindable Readline functions.

Concept Index General index for concepts described in this manual.

--------------------------------------------------------------------------------
[ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

1. Introduction
1.1 What is Bash? A short description of Bash.

1.2 What is a shell? A brief introduction to shells.

--------------------------------------------------------------------------------
[ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

1.1 What is Bash?
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.

--------------------------------------------------------------------------------
[ < ] [ > ] [ << ] [ Up ] [ >> ] [Top] [Contents] [Index] [ ? ]

1.2 What is a shell?
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 utilitites 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.

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!