The empty string is returned in that case. Substitute new for the first occurrence of old in the event line. This chapter describes how to interface the GNU History Library with programs that you write. It should be considered a technical guide. For information on the interactive use of GNU History, see section Using History Interactively .
Many programs read input from the user a line at a time.
The GNU history library is able to keep track of those lines, associate arbitrary data with each line, and utilize information from previous lines in making up new ones. The programmer using the History library has available to him functions for remembering lines on a history stack, associating arbitrary data with a line, removing lines from the stack, searching through the stack for a line containing an arbitrary text string, and referencing any line on the stack directly. In addition, a history expansion function is available which provides for a consistent user interface across many different programs. The basic history manipulation commands are similar to the history substitution used by Csh . If the programmer desires, he can use the Readline library, which includes some history manipulation by default, and has the added advantage of Emacs style command line editing.