# HistoryGroupVariables(4)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

@h0, @h1, @h2, ... @h4 - History Group Variables.

## SYNOPSIS

@h0 index - General history string
@h1 index - Buffer history string
@h2 index - Command history string
@h3 index - File history string
@h4 index - Search history string

## DESCRIPTION

The history group variables @h n index return the strings in the history buffer ad a given index. There are 5 history buffers, n, as follows:-

`0` - General history string
`1` - Buffer history string
`2` - Command history string
`3` - File history string
`4` - Search history string

Each history buffer contains 20 slots which contain the history information. The history slot is selected with the index argument which is valid in the range `0..19`, index `0` is the most recent history slot in the history group.

The history slots are automatically modified on the entry of a new command, search string etc.

@h n index returns the whole of the history string for a given slot.

## DIAGNOSTICS

An error is generated if an attempt is made to access these variables and history buffer identifier n or the index is out of range.

## EXAMPLE

The last search history may be extracted as follows:-

    set-variable #l1 @h4 0
    !force search-backward #l1
    !if &not $status
        ; Not found
    !else
        ; Found
    !endif

## NOTES

@h n was first introduced in the January 2004 release.

## SEE ALSO

read-session(3), save-session(3).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>