history ?option? ?arg arg ...?
Below are some history commands and the results they would produce:format {%s is %d years old} Alice [expr $ageInMonths/12]
History words results in history revision: see below for details.Command Result history words $ [expr $ageInMonths/12] history words 1-2 {%s is %d years old} Alice history words *a*o* {%s is %d years old} [expr $ageInMonths/12]
and suppose that the next command invoked is one of the ones on the left side of the table below. The command actually recorded in the history event will be the corresponding one on the right side of the table.set a [expr $b+2]
History revision is needed because event specifiers like -1 are only valid at a particular time: once more events have been added to the history list a different event specifier would be needed. History revision occurs even when history is invoked indirectly from the current event (e.g. a user types a command that invokes a Tcl procedure that invokes history): the top-level command whose execution eventually resulted in a history command is replaced. If you wish to invoke commands like history words without history revision, you can use history event to save the current history event and then use history change to restore it later.Command Typed Command Recorded history redo set a [expr $b+2] history s a b set b [expr $b+2] set c [history w 2] set c [expr $b+2]
Copyright © 1989-1994 The Regents of the University of California.
Copyright © 1994-1997 Sun Microsystems, Inc.