HISTORY |
|
| Purpose: | Display or modify the history list. |
| Format: | HISTORY [/A command /F /G /L /N /P /R filename] |
| command | A command to be added to the history list. |
| filename | The name of a file containing entries to be added to the history list. |
See also: DIRHISTORY, HistoryExclude and LOG.
Usage:
TCC keeps a list of the commands you have entered on the command line. See Command History and Recall for information on command recall, which allows you to use the history list to repeat or edit commands you have previously executed.
The HISTORY command lets you view and manipulate the command history list directly. If no parameters are entered, HISTORY will display the current command history list.
With the options explained below, you can clear the list, add new commands to the list without executing them, save the list in a file, or read a new list from a file.
The number of commands saved in the history list depends on the length of each command line. The history list size can be specified at startup from 8192 to 131071 characters (see the Command History Buffer Size configuration option). The default size is 8192 characters.
Your history list can be stored either locally (a separate history list for each copy of TCC) or globally (all copies of TCC share the same list). For full details see local and global history.
You can use the HISTORY command as an aid in writing batch files by redirecting the HISTORY output to a file and then editing the file appropriately. However, it is easier to use the LOG /H command for this purpose.
You can disable the history list or specify a minimum command line length to save with the Minimum Length configuration option. You can prevent any command line from being saved in the history by beginning it with an "at" sign (@).
You can exclude specific commands from the History List with the HistoryExclude variable.
You can control whether duplicate entries will be saved in the history list with the Duplicates configuration option.
You can save the history list by redirecting the output of HISTORY to a file. This example saves the command history to a file called HISTFILE and reads it back again immediately. If you leave out the HISTORY /F command on the second line, the contents of the file will be appended to the current history list instead of replacing it:
history > histfile
history /f
history /r histfile
If you need to save your command history at the end of each day's work, you might use the first of these commands in your TCSTART.BTM or other startup file, and the second in TCEXIT.BTM:
if exist c:\histfile history /r c:\histfile
history > c:\histfile
This restores the previous history list if it exists, and saves the history when TCC exits.
TCC can also load and save the history list automatically if you use the History File configuration option.
Options:
| /A | Add a command to the history list. This performs the same function as the Ctrl-K key at the command line. |
| /P | Wait for a key after displaying each page of the list. Your options at the prompt are explained in detail under Prompts. |
| /R | Read the command history from the specified file and append it to the history list currently held in memory. |
If you are creating a HISTORY /R file by hand, and need to create an entry that spans multiple lines in the file, you can do so by terminating each line, except the last, with an escape character. However, you cannot use this method to exceed the command line length limit.