^TI^The '
^TITW^history
^TI^' Set of Commands
^P^
The 
^B^history
 commands perform various operations involving the 
^I^history list
. This is a list maintained by Tcl, which records 
^I^events
 (basically commands) which have occured in the past, 
in the current session of Tcl. Typing just 
^B^history
 will print a numbered list of past events--for example, 
if you start up a Tcl interactive session and then immediately 
type 
^B^history
, you should get a history list with only one item (numbered 1), 
that item being the history command you just typed.
^P^
For all of the history commands, past events are referred to with 
an 
^I^event specifier
. This may be a positive integer 
^S^n
, in which case it refers to the 
^S^n
th command typed in the current session (starting with 1 as the first 
command); it may be a negative integer, it which case it refers to 
recently typed commands (for example, -1 means the last command, -2 
means the second-to-last command, etc.); or it may be a string, in 
which case it refers to the 
^I^most recent
 event which 
^I^matches
 the string. In this context, an event (previous command) matches the 
string if some prefix of the event is identical to the string, or if 
the 
^B^string match
 command could use the string as a pattern and successfully match it to 
the event. For example, both "
^TW^ap*nd
" and "
^TW^app
" will match an 
^B^append
 command in the history list.
