No specific user configuration
[platform/upstream/bash.git] / doc / INTRO
1                        BASH - The Bourne-Again Shell
2
3 Bash is the shell, or command language interpreter, that will appear
4 in the GNU operating system.  Bash is an sh-compatible shell that
5 incorporates useful features from the Korn shell (ksh) and C shell
6 (csh).  It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2
7 Shell and Tools standard.  It offers functional improvements over sh
8 for both programming and interactive use.  In addition, most sh scripts
9 can be run by Bash without modification. 
10
11 Bash is quite portable.  It uses a configuration system that discovers
12 characteristics of the compilation platform at build time, and may
13 therefore be built on nearly every version of UNIX.  Ports to
14 UNIX-like systems such as QNX and Minix and to non-UNIX systems such
15 as OS/2, Windows 95, and Windows NT are available. 
16
17 Bash includes the following features:
18
19 Editing and Completion
20
21 Bash offers a command-line editing facility which permits users to
22 edit command lines using familiar emacs or vi-style editing commands.
23 Editing allows corrections to be made without having to erase back
24 to the point of error or start the command line anew.  The editing
25 facilities include a feature that allows users to complete command and
26 file names.
27
28 The Bash line editing library is fully customizable.  Users may define
29 their own key bindings -- the action taken when a key is pressed.  A
30 number of variables to fine-tune editing behavior are also available.
31
32 History and Command Re-entry
33
34 The Bash history feature remembers commands entered to the shell and
35 allows them to be recalled and re-executed.  The history list may be
36 of unlimited size.  Bash allows users to search for previous commands
37 and reuse portions of those commands when composing new ones.  The
38 history list may be saved across shell sessions. 
39
40 Bash allows users to control which commands are saved on the history
41 list.
42
43 Job Control
44
45 On systems that support it, Bash provides an interface to the
46 operating system's job control facilities, which allow processes
47 to be suspended and restarted, and moved between the foreground
48 and background.  Bash allows users to selectively `forget' about
49 background jobs. 
50
51 Shell Functions and Aliases
52
53 These mechanisms are available to bind a user-selected identifier to a
54 list of commands that will be executed when the identifier is used as
55 a command name.  Functions allow local variables and recursion, and
56 have access to the environment of the calling shell.  Aliases may be
57 used to create a mnemonic for a command name, expand a single word to
58 a complex command, or ensure that a command is called with a basic set
59 of options. 
60
61 Arrays
62
63 Bash-2.0 supports indexed arrays of unlimited size.  The subscript for
64 an array is an arithmetic expression.  Arrays may be assigned to with
65 a new compound assignment syntax, and several builtins have options to
66 operate on array variables.  Bash includes a number of built-in array
67 variables.
68
69 Arithmetic
70
71 Bash allows users to perform integer arithmetic in any base from two
72 to sixty-four.  Nearly all of the C language arithmetic operators are
73 available with the same syntax and precedence as in C.  Arithmetic
74 expansion allows an arithmetic expression to be evaluated and the
75 result substituted into the command line.  Shell variables can be used
76 as operands, and the value of an expression may be assigned to a
77 variable. 
78
79 An arithmetic expression may be used as a command; the exit status of
80 the command is the value of the expression.
81
82 ANSI-C Quoting
83
84 There is a new quoting syntax that allows backslash-escaped characters
85 in strings to be expanded according to the ANSI C standard.
86
87 Tilde Expansion
88
89 Users' home directories may be expanded using this feature.  Words
90 beginning with a tilde may also be expanded to the current or previous
91 working directory.
92
93 Brace Expansion
94
95 Brace expansion is a convenient way to generate a list of strings that
96 share a common prefix or suffix.
97
98 Substring Capabilities
99
100 Bash allows new strings to be created by removing leading or trailing
101 substrings from existing variable values, or by specifying a starting
102 offset and length.  Portions of variable values may be matched against
103 shell patterns and the matching portion removed or a new value
104 substituted. 
105
106 Indirect Variable Expansion
107
108 Bash makes it easy to find the value of a shell variable whose name is
109 the value of another variable.
110
111 Expanded I/O Capabilities
112
113 Bash provides several input and output features not available in sh,
114 including the ability to:
115
116         o specify a file or file descriptor for both input and output
117         o read from or write to asynchronous processes using named pipes
118         o read lines ending in backslash
119         o display a prompt on the terminal before a read
120         o format menus and interpret responses to them
121         o echo lines exactly as input without escape processing
122
123 Control of Builtin Commands
124
125 Bash implements several builtin commands to give users more control
126 over which commands are executed.  The enable builtin allows other
127 builtin commands to be selectively enabled or disabled.  The command
128 and builtin builtins change the order in which the shell searches for
129 commands. 
130
131 On systems that provide dynamic loading, new builtins may be loaded
132 into a running shell from a shared object file.  These new builtins
133 have access to all of the shell facilities.
134
135 Help
136
137 Bash includes a built-in help facility.
138
139 Shell Optional Behavior
140
141 There is a great deal of customizable shell behavior.  The shopt
142 builtin command provides a unified interface that allows users to
143 alter shell defaults. 
144
145 Prompt Customization
146
147 Bash allows the primary and secondary prompts to be customized by
148 interpreting a number of backslash-escaped special characters. 
149 Parameter and variable expansion is also performed on the values of
150 the primary and secondary prompt strings before they are displayed. 
151
152 Security
153
154 Bash provides a restricted shell environment.  It is also possible to
155 control the execution of setuid/setgid scripts. 
156
157 Directory Stack
158
159 Bash provides a `directory stack', to which directories may be added
160 and removed.  The current directory may be changed to any directory in
161 the stack.  It is easy to toggle between two directories in the stack. 
162 The directory stack may be saved and restored across different shell
163 invocations. 
164
165 POSIX Mode
166
167 Bash is nearly completely conformant to POSIX.2.  POSIX mode changes
168 those few areas where the Bash default behavior differs from the
169 standard to match the standard.  In POSIX mode, Bash is POSIX.2
170 compliant. 
171
172 Internationalization
173
174 Bash provides a new quoting syntax that allows strings to be
175 translated according to the current locale.  The locale in which the
176 shell itself runs may also be changed, so that the shell messages
177 themselves may be language-specific. 
178
179 The command-line editing facilities allow the input of eight-bit
180 characters, so most of the ISO-8859 family of character sets are
181 supported. 
182
183 Command Timing
184
185 Bash allows external commands, shell builtin commands and shell functions
186 to be timed.  The format used to display the timing information may be
187 changed by the user.