Bash module reference guide
Table of contents
Preface
This guide will help you start configuring your Bash shell using the Bash module for the dotfile generator. Using the Bash module/dotfile generator instead of old fashioned "hairy commands"/text editor is obvious although more advanced use of the dotfiles (conditional statements in particular) is not possible (atleast not at the moment). However almost every other aspect of setting up your shell is covered including help as you go along (just press right mouse button when in doubt). Therefore it is not essential you read this guide from beginning to end, but use it as a kind of "reference manual", if further help is needed.
I have structured the contents of this guide, so they correspond to how you will encounter the options in the module remember, you do not have to visit all consecutive configuration pages when setting up your Bash shell; you are welcome to leap back and forth as you wish.
This module is prepared for the new version of Bash, namely version 2.0. I have only had chance to test the output on a version 2.00.0(1)-release of the new Bash shell, but I do not expect major changes with respect to commandnames and usage in future 2.0 releases.
If you have any comments please do not hesitate writing me. My email address is: pzacho@imada.ou.dk, or check out www.imada.ou.dk/bash for updates.
If you wish to know more about the dotfile generator, please turn to www.imada.ou.dk/~blackie/dotfile for further information.
table of contents
User/Bash Interface
In this section you can configure options concerning the interaction between User and Bash (i.e. commandline, completion and prompting etc.).
table of contents
Prompting
A collection of pages, that will help you setup how Bash is to prompt you.
table of contents
Generel
This configuration page covers generel options concerning prompting.
table of contents
Command(s) to execute before primary prompt
You can make Bash execute one or several command(s) before issuing a primary prompt.
Output
Options: (extentry) | X != "" | (*) X == "" |
Bash 1.4.14 | export PROMPT_COMMANDS=X | unset PROMPT_COMMANDS |
Bash 2.0 | export PROMPT_COMMANDS=X | unset PROMPT_COMMANDS |
(*) is default | | |
table of contents
Expansion of prompting variables
If this option is set, prompt strings undergo variable and parameter expansion after being expanded.
Output
Options: (checkbox) | off | (*) on |
Bash 1.4.14 | n/a | n/a |
Bash 2.0 | shopt -u promptvars | shopt -s promptvars |
(*) is default | | |
table of contents
Primary prompt
Here you can configure the primary prompt (prompt 1), which will be printed before reading your commands.
Output
Options: (fillout) | |
Bash 1.4.14 | export PS1=X |
Bash 2.0 | export PS1=X |
table of contents
Secondary prompt
Here you can configure the secondary prompt (prompt 2), which will be printed if the commandline is stretched over more than one line. The prompt will not be displayed if commandline wraps, or commandline scroll, but if you hit ENTER, and Bash expects further information to execute the command.
Output
Options: (fillout) | |
Bash 1.4.14 | export PS2=X |
Bash 2.0 | export PS2=X |
table of contents
Prompt 3
Here you can configure the third prompt (prompt 3), which is used in connection with the builtin command select (when waiting for user input).
Output
Options: (fillout) | |
Bash 1.4.14 | export PS3=X |
Bash 2.0 | export PS3=X |
table of contents
Prompt 4
Here you can configure the fourth prompt (prompt 4), which is used in connection with tracing shell scripts/commands with builtin xtrace. After expanding a simple-command, Bash will display the value of PS4, followed by the command and its expanded arguments.
Output
Options: (fillout) | |
Bash 1.4.14 | export PS4=X |
Bash 2.0 | export PS4=X |
table of contents
Command aliases
UNIX often have commands with very cryptic names, or numerous arguments you have to remember/type each time you use the command/program. With aliases you are saved from that kind of annoyances. If you are familiar with C shells (like Tcsh), the major difference is you cannot use arguments in alias expansions--the alias function in Bash can be compared with search-and-replace. The use of arguments is provided by functions, a sort of script-within-a-script, which you can use to define some shell code by name and store it in the shell's memory, to be invoked and run later. Due to the versatility of functions, you can not define functions (--maybe in a later version), but are you interested in writing shell functions, I can recommend the book Learning the bash Shell.
Output
Options: (extentry) | |
Bash 1.4.14 | alias name=command(s) |
Bash 2.0 | alias name=command(s) |
table of contents
Command history
This configuration page will help you setup the history function of Bash. The history mechanism records your commands, and is very useful if you make a mistake. Instead of retyping the entire commandline, you just recall the command, fix the mistake and re-execute the command. Bash has several ways to edit old commands; either by using incremental search for a single commandline by using up and down cursor keys, or using the builtin fc (fix command) command.
History file (to place previous commands)
Specify a file to save history entries in, when terminating Bash.
Output
Options: (filedirbrowser) | X != "~/.bash_history" | (*) X == "~/.bash_history" |
Bash 1.4.14 | export HISTFILE=X | |
Bash 2.0 | export HISTFILE=X | |
(*) is default | | |
table of contents
Append to an existing history file
When saving history entries, Bash can append the information to an already existing history file.
Output
Options: (checkbox) | off | on |
Bash 1.4.14 | n/a | n/a |
Bash 2.0 | shopt -u histappend | shopt -s histappend |
table of contents
Commands to ignore when memorizing
To avoid duplicate commands in the history list, or if you wish to control what is memorized, you can use this option. You can put restrictions on what is stored in the history list; ignore commands with a prepend space or ignore commands that is duplicate of previous, and a combination of both.
Output
Options: (menu) | (*) none | prepending spaces | duplicate of previous | both |
Bash 1.14.4 | unset HC | export HC=ignorespace | export HC=ignoredups | export HC=ignoreboth |
Bash 2.0 | unset HC | export HC=ignorespace | export HC=ignoredups | export HC=ignoreboth |
(*) is default HC=HISTCONTROL | | | | |
table of contents
Size of history list in memory
You can specify how many history entries to store in shell memory.
Output
Options: (integer entry) | X != 500 | (*) X == 500 |
Bash 1.14.4 | export HISTSIZE=X | |
Bash 2.0 | export HISTSIZE=X | |
(*) is default | | |
table of contents
Size history file (in lines)
You can specify how many history entries to save when terminating shell. Remember, that you should not save more entries than stored in shell memory.
Output
Options: (integer entry) | X != 500 | (*) X == 500 |
Bash 1.4.14 | export HISTFILESIZE=X | |
Bash 2.0 | export HISTFILESIZE=X | |
(*) is default | | |
table of contents
With the builtin 'fc' you can edit commands...
You can edit several commands at the same time, using the fc builtin command (see BASH(1) manual page for further information about fc). For this purpose, Bash can start your favorite editor, or just use the default editor, specified by the system variable EDITOR.
Output
Options: (radio) | (*) Use default editor | Use different editor |
Bash 1.14.4 | unset FCEDIT | export FCEDIT=X |
Bash 2.0 | unset FCEDIT | export FCEDIT=X |
(*) is default | | (X is defined below) |
table of contents
Location of prefered editor
If you should prefer a different editor from the default, when editing history entries with fc, you can specify the path and editor name here. Remember to use the complete path name.
Output
Options: (entry) | |
Bash 1.14.4 | X=/path/editor |
Bash 2.0 | X=/path/editor |
| (X is used above) |
table of contents
Save multiple-line commands in one entry
If set, Bash will try to store multiple-line commands in a singe history entry.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | unset command_oriented_history | export command_oriented_history=on |
Bash 2.0 | shopt -u cmdhist | shopt -s cmdhist |
(*) is default | | |
table of contents
Command delimiter when saving multiple-line commands
When Bash saves multiple-line commands in one history entry, you can specify how commands are saved in the history file. It is more comfortable to edit many lines with embedded newlines as delimiter, when using an editor, as to scroll for- and backwards through the commands. (Readline--the commandline editor in Bash, will accept the line even if it has embedded newlines (the command occupies several consecutive lines) instead of semicolons (one line wrapped at screen right edge).)
Output
Options: (radio) | (*) semicolon | newline |
Bash 1.14.4 | n/a | n/a |
Bash 2.0 | shopt -u lithist | shopt -s lithist |
(*) is default | | |
table of contents
Mark modified history lines
When recalling and modifieng a history entry, the shell will add an asterisk at the beginning of the commandline. This indicates the history entry has been altered, but not yet executed.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | set mark-modified-lines off | set mark-modified-lines on |
Bash 2.0 | set mark-modified-lines off | set mark-modified-lines on |
(*) is default. | (written to inputrc file) | (written to inputrc file) |
table of contents
Allow re-edit of failed history substitution
If set, and readline is being used, a user is given the opportunity to re-edit a failed history substitution.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | n/a | n/a |
Bash 2.0 | shopt -u histreedit | shopt -s histreedit |
(*) is default | | |
table of contents
History character for expansion
This character is the history expansion character, that is, the character which signals the start of a history expansion, normally '!'. History expansion is performed immediately after a complete line is read, before the shell breaks it into words. It takes place in two parts. The first is to dermine which line from the previous history to use during substitution. The second is to select protions of that line for inclusion intor the current one. An event designator is a reference to a command line entry in the history list, and here is a few (--see them in BASH(1) manual):
| |
! | Start a history substitution, except when followed by a blank, newline, = or ( |
!! | Refer to the previous command. This is a synonym for '!-1' |
!n | Refer to command line n |
!-n | Refer to the current command line minus n |
!# | The entire command line typed so far |
Output
Options: (entry) | X != "!" |
Bash 1.14.4 | export histchars=Xyz |
Bash 2.0 | export histchars=Xyz |
(y and z are defined below) | |
table of contents
History character for substitustion
This character is the quick substitution character, which is used as shorthand for re-running the previous command entered, substituting one string for another in the command.
Output
Options: (entry) | X != "^" |
Bash 1.14.4 | export histchars=xYz |
Bash 2.0 | export histchars=xYz |
(x is defined above, z below) | |
table of contents
History character for "comment"
This character is optional, and signifies that the remainder of the line is a comment, when found as the first character of a word. The history comment character causes history substitution to be skipped for the remaining words on the line. It does not necessarily cause the shell parser to treat the rest of the line as a comment.
Output
Options: (entry) | X != "" |
Bash 1.14.4 | export histchars=xyZ |
Bash 2.0 | export histchars=xyZ |
(x and y are defined above) | |
table of contents
Commandline
This configuration page will help you setup options concerning the commandline. In particular which editing mode is prefered, how to respond to scripts, etc.
Select which editor keybindings Bash is to use
You can specify how Bash commandline editor is to emulate well known editors.
Output
Options: (radio) | (*) emacs | vi |
Bash 1.14.4 | set -o emacs set editing-mode emacs | set -o vi set editing-mode vi |
Bash 2.0 | set -o emacs set editing-mode emacs | set -o vi set editing-mode vi |
(*) is default | (last option saved to inputrc) | (last option saved to inputrc) |
table of contents
Keymap for commandline editor
Here you can specify how the commandline editor will bind keys. The above does have influence on the this setting, and usually setting the above will do. The difference is constrained to how keystrokes will be interpreted. The following list will show you the difference between emacs and vi commands:
Emacs command | vi command | Meaning |
CTRL-A | 0 | Move to beginning of line |
CTRL-B | h | Move backward one character |
CTRL-D | dl or x | Delete one character forward |
CTRL-E | $ | Move to end of line |
CTRL-F | l | Move forward one character |
CTRL-G |
| Abort the current editing command and ring the terminal bell |
CTRL-J |
| Same as RETURN |
CTRL-K | d$ or D | Delete (kill) forward to end of line |
CTRL-L | CTRL-L | Clear screen and redisplay the line |
CTRL-M |
| Same as RETURN |
CTRL-N |
| Next line in command history |
CTRL-O |
| Same as RETURN, then display next line in history file |
CTRL-P |
| Previous line in command history |
CTRL-R | N | Search backward |
CTRL-S | n | Search forward |
CTRL-T |
| Transpose two characters |
CTRL-U | d0 | Kill backward from point to the beginning of line |
CTRL-V |
| Make the next character typed verbatim |
CTRL-V TAB |
| Insert a TAB |
CTRL-W |
| Kill the word behind the cursor, using whitespace as the boundary |
CTRL-X / |
| List the possible filename completions of the current word |
CTRL-X ~ |
| List the possible username completions of the current word |
CTRL-X $ |
| List the possible shell variable completions of the current word |
CTRL-X @ |
| List the possible hostname completions of the current word |
CTRL-X ! |
| List the possible command name completions of the current word |
CTRL-X ( |
| Begin saving characters into the current keyboard macro |
CTRL-X ) |
| Stop saving characters into the current keyboard macro |
CTRL-X e |
| Re-execute the last keyboard macro defined |
CTRL-X CTRL-R |
| Read in the contents of the Readline initialization file |
CTRL-X CTRL-V |
| Display version information on the instance of Bash |
CTRL-Y |
| Retrieve (yank) last item killed |
DEL | dh or X | Delete one character backward |
CTRL-[ |
| Same as ESC (most keyboards) |
ESC b | b | Move one word backward |
ESC c |
| Change word after point to all capital letters |
ESC d | dw | Delete one word forward |
ESC f | w | Move one word forward |
ESC l | ~ | Change word after point to all lowercase letters |
ESC n |
| Non-incremental forward search |
ESC p |
| Non-incremental reverse search |
ESC r |
| Undo all the changes made to this line |
ESC t |
| Transpose two words |
ESC u | ~ | Change word after point to all uppercase letters |
ESC CTRL-E |
| Perform shell alias, history, and word expansion on the line |
ESC CTRL-H | db | Delete one word backward |
ESC CTRL-Y |
| Insert the first argument to the previous command (usually the second word) at point |
ESC DEL | db | Delete one word backward |
ESC ^ |
| Perform history expansion on the line |
ESC < |
| Move to first line of history file |
ESC > |
| Move to last line of history file |
ESC . |
| Insert last word in previous command line after point |
ESC _ |
| Same as above |
TAB |
| Attempt filename completion on current word |
ESC ? |
| List the possible completions of the text before point |
ESC / | \ | Attempt filename completion on current word |
ESC ~ |
| Attempt username completion on current word |
ESC $ |
| Attempt variable completion on current word |
ESC @ |
| Attempt hostname completion on current word |
ESC ! |
| Attempt command name completion on current word |
ESC TAB |
| Attempt completion from text in the command history |
ESC ~ |
| Attempt tilde expansion on the current word |
ESC { |
| Attempt filename completion and return the list to the shell enclosed within braces |
| W | Move to beginning of next non-blank word |
| B | Move to beginning of preceding non-blank word |
| e | Move to end of current word |
| E | Move to end of current non-blank word |
| ^ | Move to first non-blank character in line |
| i | Insert text before current character |
| a | Insert text after current character |
| I | Insert text at beginning of line |
| A | Insert text at end of line |
| R | Overwrite existing text |
| dB | Delete one non-blank word backwards |
| dW | Delete one non-blank word forwards |
| dd | Equivalent to 0d$ (delete entire line) |
| C | Equivalent to c$ (delete to end of line, enter input mode) |
| cc | Equivalent to 0c$ (delete entire line, enter input mode) |
| k or - | Move backward one line |
| j or + | Move forward one line |
| G | Move to line given by repeat count |
| /string | Search forward for string |
| ?string | Search backward for string |
| fx | Move right to next occurrence of x |
| Fx | Move left to previous occurrence of x |
| tx | Move right to next occurrence of x, then back one space |
| Tx | Move left to previous occurrence of x, then forward one space |
| ; | Redo last character finding command |
| , | Redo last character firnding command in opposite direction |
| * | Do wildcard expansion (onto command line) |
| \= | Do wildcard expansion (as printed list) |
| \_ | Append last word of previous command, enter input mode |
| # | Prepend # (comment character) to the line and send it |
(Source: Learning the bash Shell by Cameron Newham & Bill Rosenblatt (© 1995 O'Reilly & Associates, Inc)
Output
Options: (menu) | (*) emacs | emacs- stnd. | emacs- meta | emacs- ctlx | vi | vi-move | vi-com. | vi-insert |
Bash 1.14.4 | set keymap emacs | set keymap emacs- standard | set keymap emacs- meta | set keymap emacs- ctlx | set keymap vi | set keymap vi- move | set keymap vi- command | set keymap vi- insert |
Bash 2.0 | set keymap emacs | set keymap emacs- standard | set keymap emacs- meta | set keymap emacs- ctlx | set keymap vi | set keymap vi-move | set keymap vi-command | set keymap vi- insert |
(*) is default | saved in inputrc | saved in inputrc | saved in inputrc | saved in inputrc | saved in inputrc | saved in inputrc | saved in inputrc | saved in inputrc |
table of contents
Use IEEE 1003.2 Posix shell standard
The Posix standard is yet another attempt to standardize UNIX. The first work, called IEEE P1003.1, was published in 1988, and covers low-level issues at the system-call level. In 1992, IEEE P1003.2 covering the shell, utility programs, and user interface issues, was ratified after six years of effort (the complete P1003.2 standard occupies about 2,000 pages, and is product of accommodating designs of existing shell code written under various Bourne-derived shells). The Posix standards are flexible, but most UNIX vendors currently comply with the POSIX 1003.1 standard, and undoubtly adhere to the POSIX 1003.2 in future releases. Anyway, Bash is nearly 100% POSIX compatible, and will work toward full compliance in future releases.
The Posix standard support functions, but the semantics are weaker: it is not possibel to define local variables, and functions cannot be exported. Also command lookup order has been changed to allow certain built-in commands to be overridden by functions since aliases are not included in the standard. Built-in commands are devided into two sets by thir positions in the command lookup order: some are processed before funtions, some after. Specifically, the built-in commands break, : (do nothing), continuem, . (source), eval, exec, exit, export, readonly, return, set, shift, trap, and unset take priority over functions.
All in all, Posix standard differs (from non-Posix?) in the way command lookup and funtion handling takes place. It is only in very rare circumstances you would ever have to use the posix mode.
Output
Options: (checkbox) | (*) off (non-Posix mode) | on (Posix mode) |
bash 1.14.4 | set +o posix | set -o posix |
bash 2.0 | set +o posix | set -o posix |
(*) is default | | |
table of contents
Allow interactive comments
When writing shell scripts, one often uses comments (#) in order to explain what a specific command or piece of program does. However, when a shellscript is executed, the interactive shell will start a new instance of itself, with the shellscript as input. (This shell is not interactive as, for instance, your login shell.) In an interactive shell, you can force the shell to evaluate lines (or words) that has a prefix "#".
Output
Options: (checkbox) | off (Disallow comments) | (*) on (Allow comments) |
bash 1.14.4 | n/a | n/a |
bash 2.0 | shopt -u interactive_comments | shopt -s interactive_comments |
(*) is default | | |
(Prior to version 2.0, interactive comments are always allowed.)
table of contents
Display shell commands before running them
All shell commands either user typed, or shell scripts, will be echoed to screen.
Output
Options: (checkbox) | (*) off (silent) | on (verbose) |
bash 1.14.4 | set +o verbose | set -o verbose |
bash 2.0 | set +o verbose | set -o verbose |
(*) is default | | |
table of contents
Display shell commands after command-line processing
Prints the shell commands, after they have been expanded. In contrast to previous, commands are writtes as shell will execute them (i.e. aliases, variables, etc. have been expanded to commands, paths, etc.)
Output
Options: (checkbox) | (*) off (no trace) | on (trace) |
bash 1.14.4 | set +o xtrace | set -o xtrace |
bash 2.0 | set +o xtrace | set -o xtrace |
(*) is default | | |
table of contents
Check command hash table, before searching path
If set, Bash checks that a command found in the hash table exists before trying to execute it. If a hashed command no longer exists, a normal (and time consuming) path search is performed.
Output
Options: (checkbox) | off (no hash table check) | on (check hash table first) |
bash 1.14.4 | n/a | n/a |
bash 2.0 | shopt -u checkhash | shopt -s checkhash |
table of contents
How many CTRL-d equals a logout or exit command?
You can specify how many consecutive CTRL-d equals an "exit" or "logout" command.
Output
Options: (integer entry) | (*) X == 10 | X != 10 |
bash 1.4.14 | set -o ignoreeof | export IGNOREEOF=X |
bash 2.0 | set -o ignoreeof | export IGNOREEOF=X |
(*) is default | | X is the number of CTRL-d keystrokes to equivalence an "exit" command. |
table of contents
Idle for X seconds before auto-logout (0 = disabled)
This option is intended for use with dial-up lines, but can also be used for other purposes (e.g. if you forget to logout).
Output
Options: (integer entry) | (*) X == 0 | X > 0 |
bash 1.14.4 | unset TMOUT | export TMOUT=X |
bash 2.0 | unset TMOUT | export TMOUT=X |
(*) is default | | |
table of contents
Location of favourite (default) editor
State the location of the default editor.
Output
Options: (filedirbrowser) | X != "" |
Bash 1.14.4 | export EDITOR=X |
Bash 2.0 | export EDITOR=X |
table of contents
Completion
This page will help you setup options concerning completion and globbing. You can complete a commandline typing TAB. Bash will complete the line based on the text before point. Bash attempts completion treating the text as a variable (if the text begins with $), username (if the text begins with ~), hostname (if the text begins with @), or command (including aliases and functions) in turn. If none of these produces a match, filename completion is attempted.
table of contents
If words have more than one possible completion...
You can select how Bash should inform you of ambiguity. You have two options, either ring the bell or list all completions.
Output
Options: (radio) | (*) ring the bell | list all completions |
Bash 1.14.4 | set show-all-if-ambigous off | set show-all-if-ambigous on |
Bash 2.0 | set show-all-if-ambigous off | set show-all-if-ambigous on |
(*) is default | (written to inputrc) | (written to inputrc) |
table of contents
Max. number of elements to show without asking
This determines when the user is queried about viewing the number of possible completions. It may be set to any integer value greater than or equal to zero. If the number of possible completions is greater than or equal to the value of theis variable, the user is asked whether or not he wishes to view them; otherwise they are simply listed on the terminal.
Output
Options: (integer entry) | X != 100 |
Bash 1.14.4 | set completions-query-items X |
Bash 2.0 | set completion-query-items X |
(100 is default) | (written to inputrc) |
table of contents
Expand tilde (~) when completing
Tilde (~) is a shortcut for the path to your home directory. If set, tilde expansion (to the path) is performed when readline attempts word completion.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | set expand-tilde off | set expand-tilde on |
Bash 2.0 | set expand-tilde off | set expand-tilde on |
(*) is default | (written to inputrc) | (written to inputrc) |
table of contents
Hostname file
File in the same format as /etc/hosts that should be read when the shell needs to complete a hostname. The file may be changed interactively; the next time hostname completion is attempted Bash adds the contents of the new file to the already existing database.
Output
Options: (entry) | X != "/etc/hosts" | X == "" |
Bash 1.14.4 | export HOSTFILE=X | unset HOSTFILE |
Bash 2.0 | export HOSTFILE=X | unset HOSTFILE |
("/etc/hosts" is default) | | |
table of contents
File suffixes to ignore upon filename completion
A colon-seperated list of suffixes to ignore when performing filename completion. A filename whose suffix matches one of the entries is excluded from the list of matched filenames.
Output
Options: (extentry) | |
Bash 1.14.4 | export FIGNORE=X |
Bash 2.0 | export FIGNORE=X |
| (X is a colon seperated list) |
table of contents
Expand wildcards (* and ? in filenames)
Before a command/program is executed, Bash will skim the commandline for wildcards. If found, Bash will glob filenames, where file names will fit the wildcard pattern. You can disable this feature, however it is not likely you have to do that.
Output
Options: (checkbox) | off (no glob) | (*) on (glob) |
Bash 1.14.4 | set -o noglob | set +o noglob |
Bash 2.0 | set -o noglob | set +o noglob |
(*) is default | | |
table of contents
Allow null-string expansion
If set, Bash allows pathname patterns which match no files to expand to a null string, rather than themselves.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | unset allow_null_glob_expansion | export allow_null_glob_expansion=on |
Bash 2.0 | shopt -u nullglob | shop -s nullglob |
(*) is default | | |
table of contents
Include dot-files upon filename globbing
If set, Bash includes filenames beginning with a '.' (dot) in the results of pathname expansion.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | unset glob_dot_filenames | export glob_dot_filenames=on |
Bash 2.0 | shopt -u dotglob | shopt -s dotglob |
(*) is default | | |
table of contents
Job control
Job control refers to the ability to selectively stop (suspend) the execution of processes and continue (resume) their execution at a later point. A user typically employs this facility via an interactive interface supplied jointly by the system's terminal driver and Bash. If the operating system on which Bash is running supports job control, Bash allows you to use it. Typing the suspend character (typically ^Z, CTRL-z) while a process is running causes that process to be stopped and returns you to Bash. You may then manupulate the state of this job, using the bg command to continue it in the background, the fg command to continue it in the foreground, or the kill command to kill it. A ^Z takes effect immediately, and has the additional side effect of causing pending output and typeahead to be discarded.
table of contents
Allow job control
This is enable for interactive shells by default (if system allows), and will run background processes in a seperate process group and a line containing their exit status is printed upon their completion.
Output
Options: (checkbox) | off | (*) on |
Bash 1.14.4 | set +o monitor | set -o monitor |
Bash 2.0 | set +o monitor | set -o monitor |
(*) is default | | |
table of contents
Fast resume of suspended jobs (auto-resume)
This option controls how the shell interacts with the user and job control. If this option is set, single word simple commands without redirections are treated as candidates for resumption of an existing stopped job. There is no ambiguity allowed; if there is more than one job beginning with the string typed, the job most recently accessed is selected. The name of a stopped job, in this context, is the command line used to start it. If set to the value exact, the string supplied must match the name of a stopped job exactly; if set to substring, the string supplied needs to match a substring of the name of a stopped job. The substring value provides functionality analogous to the %? job id (see BASH(1) manual, about JOB CONTROL). If set to any other value (in this module the value prefix), the suplied string must be a prefix of a stopped job's name; this provides funtionality analogous to the % job id.
Output
Options: (menu) | (*) disabled | substring | prefix | exact |
Bash 1.14.4 | unset a_r | export a_r=substring | export a_r=prefix | export a_r=exact |
Bash 2.0 | unset a_r | export a_r=substring | export a_r=prefix | export a_r=exact |
(*) is default (a_r=auto_resume) | | | (prefix is considered as an arbitrary value) | |
table of contents
When is Bash to notify of terminating background jobs?
You have two options, either report before next prompt, or immediately no matter what you currently are doing/writing.
Output
Options: (radio) | (*) before primary prompt | notify immediately |
Bash 1.14.4 | set +b | set -b |
Bash 2.0 | set +b | set -b |
(*) is default | | |
table of contents
Keyboard bindings
Here you can setup keyboard macros. A macro is simply a sequeence of keystrokes or a builtin (readline) command. Typing the key sequence causes the keys in the macro to be entered as though you had typed them. Some of the readline commands and their bindings you can see in Keymap for commandline editor.
table of contents
Key combination
What key sequence do you want to bind to a macro. Remember, when using key alternation (control, meta or esc), do only prefix one. The other keys (tabulator and function keys) may not accept alternation.
table of contents
Builtin commands
This is a list of builtin readline commands. Some of them are already bound by default (see Keymap for commandline editor).
table of contents
User defined text/commands
Here you can make your own command/macro. Tip: if your macro is to be evaluated by Bash, add a "Return/Enter key" at the end.
table of contents
Mail check
You can make Bash check for incoming mail, if you should choose to. The shell can't actually check for incoming mail, but it check your mail file periodically and dertermine whether the file has been modified since last check. Here you can setup how often, what file(s) to check.
table of contents
Check for mail every X seconds
Specifies how often (in seconds) Bash checks for mail. When it is time to check for mail, the shell does so before prompting.
Output
Options: (integer entry) | X != 60 | X == 0 |
Bash 1.14.4 | export MAILCHECK=X | unset MAILCHECK |
Bash 2.0 | export MAILCHECK=X | unset MAILCHECK |
(60 sec. is default) | | (Disable mailcheck) |
table of contents
Notify if mailfile has been read since last check
If a mailfile that Bash is checking for mail has been accessed since the last time it was checked, the message "The mail in mailfile has been read" is printed.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | unset MAIL_WARNING | export MAIL_WARNING=on |
Bash 2.0 | unset MAIL_WARNING | export MAIL_WARNING=on |
(*) is default | | |
table of contents
File(s) to check for incoming mail
Here you can specify one or more files to check for mail. Also you may add a message with each mailfile, useful if you e.g. split up you incoming mail with procmail.
Output
Options: (extentry) | |
Bash 1.14.4 | export MAILPATH=X |
Bash 2.0 | export MAILPATH=X |
| (X is a colon seperated list of /path/file or /path/file?message) |
table of contents
TTY appearance
This configuration page covers topics as screen dimensions, bell style, how to react on commandline exceeding screen width, etc.
table of contents
Screen width
This value is used by screen-oriented editor like vi. In most cases a default is used if they are undefined, but if you are having display problems with screen-oriented applications then you should check this setting to see if it is correct.
Output
Options: (integer entry) | X != 80 |
Bash 1.14.4 | export COLUMNS=X |
Bash 2.0 | export COLUMNS=X |
(80 is default) | |
table of contents
Screen height
This value is used by screen-oriented editor like vi. In most cases a default is used if they are undefined, but if you are having display problems with screen-oriented applications then you should check this setting to see if it is correct.
Output
Options: (integer entry) | X != 24 |
Bash 1.14.4 | export LINES=X |
Bash 2.0 | export LINES=X |
(24 is default) | |
table of contents
Automatic update of screen width/height
If set, bash checks the window size after each command and, if necessary, updates the values of LINES and COLUMNS.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | n/a | n/a |
Bash 2.0 | shopt -u checkwinsize | shopt -s checkwinsize |
(*) is default | | |
table of contents
If commandline exceeds screen width...
If set, lines will scroll horizontally if you type beyond the right-hand side of the screen, else lines will wrap onto a new screen line.
Output
Options: (radio) | (*) wrap onto new line | scroll horizontally |
Bash 1.14.4 | set horizontal-scroll-mode off | set horizontal-scroll-mode on |
Bash 2.0 | set horizontal-scroll-mode off | set horizontal-scroll-mode on |
(*) is default | (written to inputrc) | (written to inputrc) |
table of contents
Bell type
If set to none then Readline (the commandline editor) never rings the bell (beeps). If set to visible, Readline will attempt to use a visible bell. If set to audible then it will attempt to ring the bell, which is default.
Output
Options: (radio) | none (disabled) | (*) audible | visible |
Bash 1.14.4 | set bell-style none | set bell-style audible | set bell-style visible |
Bash 2.0 | set bell-style none | set bell-style audible | set bell-style visible |
(*) is default | (written to inputrc) | (written to inputrc) | (written to inputrc) |
table of contents
Allow 8-bit characters in commandline
If set, eight-bit input will be accepted. (When set, I've had problems with meta alternated keystrokes, as meta-TAB?)
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | set meta-flag off | set meta-flag on |
Bash 2.0 | set meta-flag off | set meta-flag on |
(*) is default | (written to inputrc) | (written to inputrc) |
table of contents
Convert 8-bit characters to ESC sequences
If set, Readline (the commandline editor) will convert characters with the eighth bit set to an ASCII key sequence by stripping the eighth bit and prepending an ESC character.
Output
Options: (checkbox) | off | (*) on |
Bash 1.14.4 | set convert-meta off | set convert-meta on |
Bash 2.0 | set convert-meta off | set convert-meta on |
(*) is default | (written to inputrc) | (written to inputrc) |
table of contents
Display 8-bit characters
If set, Bash will display characters with the eighth bit set directly.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | set output-meta off | set output-meta on |
Bash 2.0 | set output-meta off | set output-meta on |
(*) is default | (written to inputrc) | (written to inputrc) |
table of contents
System/Bash interface
Here you can configure options that have no affect on interactive communication with user--not directly anyway. In this group options on file creation, path search, etc. is found. Please remember, options in this section is to be altered with much care, as much of this information is essential for the shell to work properly.
table of contents
Error handling
This configuration page will help you to setup options concerning certain exceptions.
table of contents
Treat undefined variables as errors
Treat unset variables as an error when performing parameter expansion. If expansion is attempted on an unset variable, the shell prints an error message, and, if not interactive, exits with a non-zero status.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | set +o nounset | set -o nounset |
Bash 2.0 | set +o nounset | set -o nounset |
(*) is default | | |
table of contents
Non-interactive shell exit if 'exec'-call fails
If this option is unchecked, a non-interactive shell will not exit if it cannot execute the file specified in the exec builtin command. An interactive shell does not exit if exec fails.
Output
Options: (checkbox) | (*) on | off |
Bash 1.14.4 | unset no_exit_on_failed_exec | export no_exit_on_failed_exec=on |
Bash 2.0 | shopt -u execfail | shopt -s execfail |
(*) is default | | |
table of contents
Exit shell if 'simple' command fails
Exit immediately if a simple-command (see BASH(1) manual, about notify under Shell Variables) exits with a non-zero status. The shell does not exit if the command that fails is part of an until or while loop, part of an if statement, part of a && or || list, or if the command's return value is being inverted via !.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | set +o errexit | set -o errexit |
Bash 2.0 | set +o errexit | set -o errexit |
(*) is default | | |
table of contents
Halt if 'shift'-ing exceeds number of arguments
The builtin shift prints an error message when the shift count exceeds the number of positional parameters. Shift is used to alter argument variables $X. For instance, "convert -f abc.txt def.html", where convert is a shell script, will bind variables as follows; $1=-f, $2=abc.txt and $3=def.html. The flag "-f" if optional, and often one would just test on the presence of a flag, do something, and continue evaluation. Shift lets you eliminate the flag, by shifting down the arguments, so variable bindings now are; $1=abc.txt and $2=def.html. If not specified, only one "shift" is performed. In versions prior to Bash 2.0, there is no test if shift exceedes the number of arguments.
Output
Options: (checkbox) | off | on |
Bash 1.14.4 | n/a | n/a |
Bash 2.0 | shopt -u shift_verbose | shopt -s shift_verbose |
table of contents
File and directory handling
This configuration page will help you to setup options concerning file and directory handling, how to follow links, etc.
table of contents
Allow redirected output overwriting existing files
If set, Bash does not overwrite an existing file with the >, >&, and <> redirection operators. This option may be overridden when creating output files by using the redirection operator >! instead of >.
Output
Options: (checkbox) | off | on |
Bash 1.14.4 | set +o noclobber | set -o noclobber |
Bash 2.0 | set +o noclobber | set -o noclobber |
table of contents
File/dir creation mask
Specify with what permissions you create files/directories.
Default configuration
| Read | Write | Execute |
User | Read/Read | (over-)Write/Create files | Execute/"cd" to |
Group | Read/Read | not allowed/not allowed | Execute/"cd" to |
Other | Read/Read | not allowed/not allowed | Execute/"cd" to |
| (file/dir) | (file/dir) | (file/dir) |
table of contents
How is Bash to follow directory links?
If set, do not follow symbolic links when performing commands such as cd which change the current directory. The physical directory is used instead.
Output
Options: (radio) | (*) logically | physically |
Bash 1.14.4 | set +o physical | set -o physical |
Bash 2.0 | set +o physical | set -o physical |
(*) is default | | |
table of contents
"cd" allows variables as argument
If set, an argument to the cd builtin command that is not a directory is assumed to be the name of a varaible whose value is the directory to change to.
Output
Options: (checkbox) | (*) off | on |
Bash 1.14.4 | unset cdable_vars | export cdable_vars=on |
Bash 2.0 | shopt -u cdable_vars | shopt -s cdable_vars |
(*) is default | | |
table of contents
"cd" guess directory name if misspelled
If set, minor errors in the spelling of a directory component in a cd command will be corrected. The errors checked for are transposed characters, a missing character, and one character too many. If a correction is found, the corrected file name is printed, and the command proceeds. This option is enabled by default, but is only used by interactive shells.
Output
Options: (checkbox) | off | (*) on |
Bash 1.14.4 | n/a | n/a |
Bash 2.0 | shopt -u cdspell | shopt -s cdspell |
(*) is default | | |
table of contents
Paths
This configuration page will help you to setup paths. If a path is already defined, the Bash module will attempt to read it and auto-fillout the entries. You can then add, or delete in the list as you please, just bear in mind not to compromise with system security.
table of contents
Command path
The search path for commands. It is a list of directories in which the shell looks for commands. The default path is system-dependent, and is set by the administrator who installs Bash. A common path is: "/usr/gnu/bin:/usr/local/bin:/usr/ucb:/bin:/usr/bin:.".
Output
Options: (extentry) | |
Bash 1.14.4 | PATH=X; export PATH |
Bash 2.0 | PATH=X; export PATH |
| (X is a colon seperated list) |
table of contents
"cd" path
The search path for the cd command. This is a list of directories in which the shell looks for destination directories specified by the cd command.
Output
Options: (extentry) | |
Bash 1.14.4 | CDPATH=X; export CDPATH |
Bash 2.0 | CDPATH=X; export CDPATH |
| (X is a colon seperated list) |
table of contents
Manual path
The search path for the man command. This is a list of directories in which the man program looks for manual pages. A common path is: "/usr/man:/usr/X11/man".
Output
Options: (extentry) | |
Bash 1.14.4 | MANPATH=X; export MANPATH |
Bash 2.0 | MANPATH=X; export MANPATH |
| (X is a colon seperated list) |
table of contents
System limits
This configuration page will help you to setup how system resources are shared, e.g. how much disk space a user file may allocate, how much memory and CPU-time a user process can allocate, etc.
table of contents
Data/Stack segment
Data/Stack segments have to do with dynamic memory allocations, i.e. memory, which a process allocate at runtime. Usually you will not have to limit a proces's data/stack segment.
Output
Options: (entry) | Data segment | Stack segment |
Bash 1.14.4 | ulimit -d X | ulimit -s X |
Bash 2.0 | ulimit -d X | ulimit -s X |
(X is either a value or "unlimited") | | |
table of contents
Main/Virtual memory
Main/Virtual memory options are similar to the two above. This option limits all uses of memory. You normally will not have to put a limit on this unless your system suffers severe memory constraints or you want to avoid thrashing.
Output
Options: (entry) | Main memory | Virtual memory |
Bash 1.14.4 | ulimit -m X | ulimit -v X |
Bash 2.0 | ulimit -m X | ulimit -v X |
(X is either a value or "unlimited") | | |
table of contents
File size
Put a limit on how much diskspace a file can allocate (often huge files are the work of buggy programs). This is useful if you have constraints on disk space.
Output
Options: (entry) | |
Bash 1.14.4 | ulimit -f X |
Bash 2.0 | ulimit -f X |
(X is either a value or "unlimited") | |
table of contents
Core-dump size
If a program halts abruptly--either by user or due to a program bug, the system makes a core-dump (memory dump). These files are often quite large and, unless you intend to debug the failing program, of no interest.
Output
Options: (entry) | |
Bash 1.14.4 | ulimit -c X |
Bash 2.0 | ulimit -c X |
(X is either a value or "unlimited") | |
File descriptors
Put a limit on how many files to have open at the same time per process. Usually you will not have to limit this number. Do not set the number too low, many programs and commands opens several files at the same time (e.g. performing a "ls" require at least five file descriptors). Some older versions of UNIX will not let you alter this number--they have a fixed limit of 20 file descriptors per process.
Output
Options: (entry) | |
Bash 1.14.4 | ulimit -n X |
Bash 2.0 | ulimit -n X |
(X is either a value or "unlimited") | |
table of contents
Pipe size
Set the size for a pipe between two commands/programs. A pipe (|) is to be considered as a fifo (first-in-first-out) queue, where information from sender (command/program) is stored until receiver reads it. You can specify how much memory Bash is to allocate for this buffer, in 512-byte increments.
Output
Options: (entry) | |
Bash 1.14.4 | ulimit -p X |
Bash 2.0 | ulimit -p X |
(X is either a value or "unlimited") | |
table of contents
CPU time
Limit amount of CPU-time a process can use. This is a possible guard againts infinite loops, although it also limits how long a non-buggy program is allowed to run. You are probably better off, leaving this option unlimited.
Output
Options: (entry) | |
Bash 1.14.4 | ulimit -t X |
Bash 2.0 | ulimit -t X |
(X is either a value or "unlimited") | |
table of contents
# (number) of procs
Limit number of processes a user can start. Useful if you have system memory constraints.
Output
Options: (entry) | |
Bash 1.14.4 | ulimit -u X |
Bash 2.0 | ulimit -u X |
(X is either a value or "unlimited") | |
table of contents
Bash version
In contrast to the other configuration pages, this page will not create any output, when generating. Here you can specify which version of Bash you want to generate dot.files for.
table of contents
|