Import readline 7.0 (patch 5)
[deliverable/binutils-gdb.git] / readline / doc / hsuser.texi
index 9aa6c358dbe4e023fde5557c0391a420e298d3a7..311933ab43fbc79b43e09d88b5d5026f924c823a 100644 (file)
@@ -1,7 +1,7 @@
 @ignore
 This file documents the user interface to the GNU History library.
 
-Copyright (C) 1988--2011 Free Software Foundation, Inc.
+Copyright (C) 1988--2016 Free Software Foundation, Inc.
 Authored by Brian Fox and Chet Ramey.
 
 Permission is granted to make and distribute verbatim copies of this manual
@@ -86,24 +86,25 @@ file named by the @env{HISTFILE} variable (default @file{~/.bash_history}).
 The file named by the value of @env{HISTFILE} is truncated, if
 necessary, to contain no more than the number of lines specified by
 the value of the @env{HISTFILESIZE} variable.
-When an interactive shell exits, the last
+When a shell with history enabled exits, the last
 @env{$HISTSIZE} lines are copied from the history list to the file
 named by @env{$HISTFILE}.
 If the @code{histappend} shell option is set (@pxref{Bash Builtins}),
 the lines are appended to the history file,
 otherwise the history file is overwritten.
 If @env{HISTFILE}
-is unset, or if the history file is unwritable, the history is
-not saved.  After saving the history, the history file is truncated
-to contain no more than @env{$HISTFILESIZE}
-lines.  If @env{HISTFILESIZE} is not set, no truncation is performed.
+is unset, or if the history file is unwritable, the history is not saved.
+After saving the history, the history file is truncated
+to contain no more than @env{$HISTFILESIZE} lines.
+If @env{HISTFILESIZE} is unset, or set to null, a non-numeric value, or
+a numeric value less than zero, the history file is not truncated.
 
 If the @env{HISTTIMEFORMAT} is set, the time stamp information
 associated with each history entry is written to the history file,
 marked with the history comment character.
 When the history file is read, lines beginning with the history
 comment character followed immediately by a digit are interpreted
-as timestamps for the previous history line.
+as timestamps for the following history entry.
 
 The builtin command @code{fc} may be used to list or edit and re-execute
 a portion of the history list.
@@ -143,8 +144,10 @@ history list and history file.
 @code{fc -s [@var{pat}=@var{rep}] [@var{command}]}
 @end example
 
-Fix Command.  In the first form, a range of commands from @var{first} to
-@var{last} is selected from the history list.  Both @var{first} and
+The first form selects a range of commands from @var{first} to
+@var{last} from the history list and displays or edits and re-executes
+them.
+Both @var{first} and
 @var{last} may be specified as a string (to locate the most recent
 command beginning with that string) or as a number (an index into the
 history list, where a negative number is used as an offset from the
@@ -163,6 +166,7 @@ When editing is complete, the edited commands are echoed and executed.
 
 In the second form, @var{command} is re-executed after each instance
 of @var{pat} in the selected command is replaced by @var{rep}.
+@var{command} is intepreted the same as @var{first} above.
 
 A useful alias to use with the @code{fc} command is @code{r='fc -s'}, so
 that typing @samp{r cc} runs the last command beginning with @code{cc}
@@ -200,9 +204,9 @@ Delete the history entry at position @var{offset}.
 displayed.
 
 @item -a
-Append the new
-history lines (history lines entered since the beginning of the
-current Bash session) to the history file.
+Append the new history lines to the history file.
+These are history lines entered since the beginning of the current
+Bash session, but not already appended to the history file.
 
 @item -n
 Append the history lines not already read from the history file
@@ -210,11 +214,11 @@ to the current history list.  These are lines appended to the history
 file since the beginning of the current Bash session.
 
 @item -r
-Read the current history file and append its contents to
+Read the history file and append its contents to
 the history list.
 
 @item -w
-Write out the current history to the history file.
+Write out the current history list to the history file.
 
 @item -p
 Perform history substitution on the @var{arg}s and display the result
@@ -247,6 +251,11 @@ the input stream, making it easy to repeat commands, insert the
 arguments to a previous command into the current input line, or
 fix errors in previous commands quickly.
 
+@ifset BashFeatures
+History expansion is performed immediately after a complete line
+is read, before the shell breaks it into words.
+@end ifset
+
 History expansion takes place in two parts.  The first is to determine
 which line from the history list should be used during substitution.
 The second is to select portions of that line for inclusion into the
@@ -260,7 +269,9 @@ History expansions are introduced by the appearance of the
 history expansion character, which is @samp{!} by default.
 @ifset BashFeatures
 Only @samp{\} and @samp{'} may be used to escape the history expansion
-character.
+character, but the history expansion character is
+also treated as quoted if it immediately precedes the closing double quote
+in a double-quoted string. 
 @end ifset
 
 @ifset BashFeatures
This page took 0.02586 seconds and 4 git commands to generate.