. . . I offer the following excerpt from the documentation for my ICB client, ICBM:
ICBM also has several ways of recalling previously-typed messages or commands. If you type '!foo' and hit enter, the last line that you typed which began with 'foo' (if there is one) will be recalled from your history buffer and placed in the write buffer for you to resend as-is or edit further. If there is no prior matching line, nothing will happen.
If you type '^foo^bar', the last line you typed (if there is one) will be recalled to the write buffer with all instances of the first term ('foo' in this example) replaced with the second term ('bar'). If the first term is not found in the last line typed or the history buffer is empty, nothing will happen.
Both of these operators are case-sensitive.
It is possible to combine both operators in a single command with the syntax !foo^bar^baz. In this form, first the last line beginning with foo is retrieved from history, then substitution is performed on the retrieved line. If any step fails, the entire command does nothing.
For example, if a few minutes ago you had previously typed:
The dog is stalking the catAnd then you realized that it was actually the tiger that the dog was stalking, you could type:
!The dog^cat^tigerAfter you hit enter, your input buffer would now contain:
The dog is stalking the tiger(The tiger would probably very shortly contain the dog, but that problem is outside the scope of this document.)