|Purpose:||Display or modify the history list|
|Format:||HISTORY [/A command /F["..."] /G /L /N /P /Rn filename /Tn /V]|
|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.|
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 4,000 to 500,000 characters (see the Command History Buffer Size configuration option). The default size is 20,000 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 /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.
|/=||Display the HISTORY command dialog to help you set the filename and command line options. You cannot specify any other arguments on the command line.|
|/A||Add a command to the history list. This performs the same function as the Ctrl-K key at the command line.|
|/F["..."]||Erase entries in the command history list. You can have multiple /F"..." arguments, and they can contain wildcards. If you don't include the optional quoted argument, /F will erase the entire list.|
|/P||Wait for a key after displaying each page of the list. Your options at the prompt are explained in detail under Prompts.|
|/Rn||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.
If you try to load a file that is larger than the history list size, HISTORY will only load the last part of the file that will fit.
You can optionally specify whether HISTORY should ignore duplicates and HistoryExclude and always append the lines by specifying /R1. (This will be considerably faster for large history lists.)
|/Tn||Display the last n lines of the history. If n is negative, skip the first -n lines of the history.|