chapter_title
stringclasses
9 values
section_title
stringlengths
6
77
num_words
int64
7
5.33k
num_chars
int64
47
32.6k
text
stringlengths
47
32.6k
Command Line Editing
Commands For Moving
345
2,034
beginning-of-line (C-a) Move to the start of the current line. This may also be bound to the Home key on some keyboards. end-of-line (C-e) Move to the end of the line. This may also be bound to the End key on some keyboards. forward-char (C-f) Move forward a character. This may also be bound to the right arrow key on s...
Command Line Editing
Commands For Manipulating The History
742
4,623
accept-line (Newline or Return) Accept the line regardless of where the cursor is. If this line is non-empty, add it to the history list according to the setting of the HISTCONTROL and HISTIGNORE variables. If this line is a modified history line, then restore the history line to its original state. previous-history (C...
Command Line Editing
Commands For Changing Text
568
3,454
end-of-file (usually C-d) The character indicating end-of-file as set, for example, by stty. If this character is read when there are no characters on the line, and point is at the beginning of the line, Readline interprets it as the end of input and returns eof. delete-char (C-d) Delete the character at point. If this...
Command Line Editing
Killing And Yanking
369
2,225
kill-line (C-k) Kill the text from point to the end of the current line. With a negative numeric argument, kill backward from the cursor to the beginning of the line. backward-kill-line (C-x Rubout) Kill backward from the cursor to the beginning of the current line. With a negative numeric argument, kill forward from ...
Command Line Editing
Specifying Numeric Arguments
141
844
digit-argument (M-0, M-1,... M--) Add this digit to the argument already accumulating, or start a new argument. M-- starts a negative argument. universal-argument () This is another way to specify an argument. If this command is followed by one or more digits, optionally with a leading minus sign, those digits define t...
Command Line Editing
Letting Readline Type For You
739
4,760
complete (TAB) Attempt to perform completion on the text before point. The actual completion performed is application-specific. Bash attempts completion by first checking for any programmable completions for the command word, otherwise treating the text as a variable (if the text begins with ‘$’), username (if the text...
Command Line Editing
Keyboard Macros
69
453
start-kbd-macro (C-x () Begin saving the characters typed into the current keyboard macro. end-kbd-macro (C-x )) Stop saving the characters typed into the current keyboard macro and save the definition. call-last-kbd-macro (C-x e) Re-execute the last keyboard macro defined, by making the characters in the macro appear ...
Command Line Editing
Some Miscellaneous Commands
881
5,566
re-read-init-file (C-x C-r) Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there. abort (C-g) Abort the current editing command and ring the terminal’s bell (subject to the setting of bell-style). do-lowercase-version (M-A, M-B, M-x,...) If the metafied character x...
Command Line Editing
Readline vi Mode
126
689
While the Readline library does not have a full set of vi editing functions, it does contain enough to allow simple editing of the line. The Readline vi mode behaves as specified in the sh description in the posix standard. You can use the ‘set -o emacs’ and ‘set -o vi’ commands to switch interactively between emacs an...
Command Line Editing
Programmable Completion
1,250
7,808
When the user attempts word completion for a command or an argument to a command for which a completion specification (a compspec) has been defined using the complete builtin, Readline invokes the programmable completion facilities. First, Bash identifies the command name. If a compspec has been defined for that comman...
Command Line Editing
Programmable Completion Builtins
1,381
8,630
Three builtin commands are available to manipulate the programmable completion facilities: one to specify how the arguments to a particular command are to be completed, and two to modify the completion as it is happening. compgen compgen [-V varname] [option] [word] Generate possible completion matches for word accordi...
Command Line Editing
A Programmable Completion Example
707
4,375
The most common way to obtain additional completion functionality beyond the default actions complete and compgen provide is to use a shell function and bind it to a particular command using complete -F. The following function provides completions for the cd builtin. It is a reasonably good example of what shell functi...
Using History Interactively
Using History Interactively
39
243
This chapter describes how to use the gnu History Library interactively, from a user’s standpoint. It should be considered a user’s guide. For information on using the gnu History Library in other programs, see the gnu Readline Library Manual.
Using History Interactively
Bash History Facilities
510
3,187
When the -o history option to the set builtin is enabled, the shell provides access to the command history, the list of commands previously typed. The value of the HISTSIZE shell variable is used as the number of commands to save in a history list: the shell saves the text of the last $HISTSIZE commands (default 500). ...
Using History Interactively
Bash History Builtins
913
5,241
Bash provides two builtin commands which manipulate the history list and history file. fc fc [-e ename] [-lnr] [first] [last] fc -s [pat=rep] [command] The first form selects a range of commands from first to last from the history list and displays or edits and re-executes them. Both first and last may be specified as ...
Using History Interactively
History Expansion
674
4,291
The shell provides a history expansion feature that is similar to the history expansion provided by csh (also referred to as history substitution where appropriate). This section describes the syntax used to manipulate the history information. History expansion is enabled by default for interactive shells, and can be d...
Using History Interactively
Event Designators
210
1,259
An event designator is a reference to an entry in the history list. The event designator consists of the portion of the word beginning with the history expansion character, and ending with the word designator if one is present, or the end of the word. Unless the reference is absolute, events are relative to the current...
Using History Interactively
Word Designators
348
1,933
Word designators are used to select desired words from the event. They are optional; if the word designator isn’t supplied, the history expansion uses the entire event. A ‘:’ separates the event specification from the word designator. It may be omitted if the word designator begins with a ‘^’, ‘$’, ‘*’, ‘-’, or ‘%’. Wo...
Using History Interactively
Modifiers
276
1,556
After the optional word designator, you can add a sequence of one or more of the following modifiers, each preceded by a ‘:’. These modify, or edit, the word or words selected from the history event. h Remove a trailing filename component, leaving only the head. t Remove all leading filename components, leaving the ...
Installing Bash
Installing Bash
41
287
This chapter provides basic instructions for installing Bash on the various supported platforms. The distribution supports the gnu operating systems, nearly every version of Unix, and several non-Unix systems such as BeOS and Interix. Other independent ports exist for Windows platforms.
Installing Bash
Basic Installation
512
3,242
These are installation instructions for Bash. The simplest way to compile Bash is: 1. cd to the directory containing the source code and type ‘./configure’ to configure Bash for your system. If you’re using csh on an old version of System V, you might need to type ‘sh./configure’ instead to prevent csh from trying to e...
Installing Bash
Compilers and Options
76
508
Some systems require unusual options for compilation or linking that the configure script does not know about. You can give configure initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix./configure...
Installing Bash
Compiling For Multiple Architectures
223
1,377
You can compile Bash for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of make that supports the VPATH variable, such as GNU make. cd to the directory where you want the object files and executables to go and...
Installing Bash
Installation Names
259
1,822
By default, ‘make install’ will install into /usr/local/bin, /usr/local/man, etc.; that is, the installation prefix defaults to /usr/local. You can specify an installation prefix other than /usr/local by giving configure the option --prefix=PATH, or by specifying a value for the prefix ‘make’ variable when running ‘mak...
Installing Bash
Specifying the System Type
84
505
There may be some features configure can not figure out automatically, but needs to determine by the type of host Bash will run on. Usually configure can figure that out, but if it prints a message saying it can not guess the host type, give it the --host=TYPE option. ‘TYPE’ can either be a short name for the system ty...
Installing Bash
Sharing Defaults
76
472
If you want to set default values for configure scripts to share, you can create a site shell script called config.site that gives default values for variables like CC, cache_ file, and prefix. configure looks for PREFIX/share/config.site if it exists, then PREFIX/etc/config.site if it exists. Or, you can set the CONFI...
Installing Bash
Operation Controls
104
701
configure recognizes the following options to control how it operates. --cache-file=file Use and save the results of the tests in file instead of./config.cache. Set file to /dev/null to disable caching, for debugging configure. --help Print a summary of the options to configure, and exit. --quiet --silent -q Do not ...
Installing Bash
Optional Features
1,372
9,890
The Bash configure has a number of --enable-feature options, where feature indicates an optional part of Bash. There are also several --with-package options, where package is something like ‘bash-malloc’ or ‘afs’. To turn off the default use of a package, use --without-package. To configure Bash without a feature that ...