Option
| Meaning
|
cdable_vars
| If set, an argument to the cd built-in command that is not a directory is assumed to be the name of a variable whose value is the directory to change to.
|
checkhash
| 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 path search is performed.
|
cmdhist
| If set, bash attempts to save all lines of a multiple-line command in the same history entry.
|
dotglob
| If set, bash includes filenames beginning with a . (dot) in the results of pathname expansion.
|
execfail
| If set, a non-interactive shell will not exit if it cannot execute the file specified as an argument to the exec command. An interactive shell does not exit if exec fails.
|
histappend
| If set, the history list is appended to the file named by the value of the HISTFILE variable when the shell exits, rather than overwriting the file.
|
lithist
| If set, and the cmdhist option is enabled, multiline commands are saved to the history with embedded newlines, rather than using semicolon separators where possible.
|
mailwarn
| If set, and a file 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 displayed.
|
Table 3-4. Editing mode variables
|
Variable
| Meaning
|
HISTCMD
| The history number of the current command.
|
HISTCONTROL
| A list of patterns, separated by colons ( , which can have the following values. ignorespace: lines beginning with a space are not entered into the history list. ignoredups: lines matching the last history line are not entered. erasedups: all previous lines matching the current line are removed from the history list before the line is saved. ignoreboth: enables both ignorespace and ignoredups.[url=mk MSITStore :%5Cblog%5C@Linux%5Cshell%5Coreilly.learning.the.bash.shell.3rd.edition.mar.2005.ebook-ddu.chm::/0596009658/bash3-CHP-3-SECT-4.html#bash3-CHP-3-FNOTE-8%23bash3-CHP-3-FNOTE-8][8][/url]
|
HISTIGNORE
| A list of patterns, separated by colons ( , used to decide which command lines to save in the history list. Patterns are considered to start at the beginning of the command line and must fully specify the line, i.e., no wildcard (*) is implicitly appended. The patterns are checked against the line after HISTCONTROL is applied. An ampersand (& matches the previous line. An explicit & may be generated by escaping it with a backslash.[url=mk MSITStore :%5Cblog%5C@Linux%5Cshell%5Coreilly.learning.the.bash.shell.3rd.edition.mar.2005.ebook-ddu.chm::/0596009658/bash3-CHP-3-SECT-4.html#bash3-CHP-3-FNOTE-9%23bash3-CHP-3-FNOTE-9][9][/url]
|
HISTFILE
| Name of history file in which the command history is saved. The default is ~/.bash_history.
|
HISTFILESIZE
| The maximum number of lines to store in the history file. The default is 500. When this variable is assigned a value, the history file is truncated, if necessary, to the given number of lines.
|
HISTSIZE
| The maximum number of commands to remember in the command history. The default is 500.
|
HISTTIMEFORMAT
| If it is set and not null, its value is used as a format string for strftime(3) to print the time stamp associated with each history entry displayed by the history command. Time stamps are written to the history file so they may be preserved across shell sessions.[url=mk MSITStore :%5Cblog%5C@Linux%5Cshell%5Coreilly.learning.the.bash.shell.3rd.edition.mar.2005.ebook-ddu.chm::/0596009658/bash3-CHP-3-SECT-4.html#bash3-CHP-3-FNOTE-10%23bash3-CHP-3-FNOTE-10][10][/url]
|
FCEDIT
| Pathname of the editor to use with the fc command.
|
Table 3-5. Time stamp formats
|
Format
| Replaced by
|
%a
| The locale's abbreviated weekday name
|
%A
| The locale's full weekday name
|
%b
| The locale's abbreviated month name
|
%B
| The locale's full month name
|
%c
| The locale's appropriate date and time representation
|
%C
| The century number (the year divided by 100 and truncated to an integer) as a decimal number [00-99]
|
%d
| The day of the month as a decimal number [01-31]
|
%D
| The date in American format; the same value as %m/%d/%y.
|
%e
| The day of the month as a decimal number [1-31]; a single digit is preceded by a space
|
%h
| The same as %b
|
%H
| The hour (24-hour clock) as a decimal number [00-23]
|
%I
| The hour (12-hour clock) as a decimal number [01-12]
|
%j
| The day of the year as a decimal number [001-366]
|
%m
| The month as a decimal number [01-12]
|
%M
| The minute as a decimal number [00-59]
|
%n
| A newline character
|
%p
| The locale's equivalent of either a.m. or p.m
|
%r
| The time in a.m. and p.m. notation; in the POSIX locale this is equivalent to %I:%M:%S %p
|
%R
| The time in 24-hour notation (%H:%M)
|
%S
| The second as a decimal number [00-61]
|
%t
| A tab character
|
%T
| The time (%H:%M:%S)
|
%u
| The weekday as a decimal number [1-7], with 1 representing Monday
|
%U
| The week number of the year (Sunday as the first day of the week) as a decimal number [00-53]
|
%V
| The week number of the year (Monday as the first day of the week) as a decimal number [01-53]; if the week containing 1 January has four or more days in the new year, then it is considered week 1—otherwise, it is the last week of the previous year, and the next week is week 1
|
%w
| The weekday as a decimal number [0-6], with 0 representing Sunday
|
%W
| The week number of the year (Monday as the first day of the week) as a decimal number [00-53]; all days in a new year preceding the first Monday are considered to be in week 0
|
%x
| The locale's appropriate date representation
|
%X
| The locale's appropriate time representation
|
%y
| The year without century as a decimal number [00-99]
|
%Y
| The year with century as a decimal number
|
%Z
| The timezone name or abbreviation, or by nothing if no timezone information exists
|
%%
| %
|
Table 3-7. Prompt string customizations
|
Command
| Meaning
|
\a
| The ASCII bell character (007)
|
\A
| The current time in 24-hour HH:MM format
|
\d
| The date in "Weekday Month Day" format
|
\D {format}
| The format is passed to strftime(3) and the result is inserted into the prompt string; an empty format results in a locale-specific time representation; the braces are required
|
\e
| The ASCII escape character (033)
|
\H
| The hostname
|
\h
| The hostname up to the first "."
|
\j
| The number of jobs currently managed by the shell
|
\l
| The basename of the shell's terminal device name
|
\n
| A carriage return and line feed
|
\r
| A carriage return
|
\s
| The name of the shell
|
\T
| The current time in 12-hour HH:MM:SS format
|
\t
| The current time in HH:MM:SS format
|
\@
| The current time in 12-hour a.m./p.m. format
|
\u
| The username of the current user
|
\v
| The version of bash (e.g., 2.00)
|
\V
| The release of bash; the version and patchlevel (e.g., 2.00.0)
|
\w
| The current working directory
|
\W
| The basename of the current working directory
|
\#
| The command number of the current command
|
\!
| The history number of the current command
|
\$
| If the effective UID is 0, print a #, otherwise print a $
|
\nnn
| Character code in octal
|
\\
| Print a backslash
|
\[
| Begin a sequence of non-printing characters, such as terminal control sequences
|
\]
| End a sequence of non-printing characters
|