Profile

unixronin: Galen the technomage, from Babylon 5: Crusade (Default)
Unixronin

December 2012

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
3031     

Most Popular Tags

Expand Cut Tags

No cut tags
Monday, March 29th, 2004 10:47 pm

. . . 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 cat

And then you realized that it was actually the tiger that the dog was stalking, you could type:

!The dog^cat^tiger

After 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.)