Quick Tutorial
Editing Files
Search Commands
Bit-wise Operations
Find and Replace
Yank and Put
Partial File Read



Command Overview


Deutsche Beschreibung

Quick Tutorial
Find and Replace

The :s (substitute) command behaves a little bit different to that of vi. If you type a command like this in vi   :s/XXXX/UU/ then the four XXXX's are replaced by two UU's. This means, the file size decreases and all characters after the replacement are moved to another position in the file. Since bvi does not move characters, only two XX's are replaced by two UU's and the third and fourth X still remains in the file.
Another example:


This command replaces within the first 500 bytes of a file the 0 - terminated ASCII string "Taste" with the 0 - terminated string "Key". After the substitution you will find a character sequence "Key\0e\0" in the file.
CAUTION: If the replace string is longer than the find string, additional bytes are overwritten!
This behaviour will not be changed by setting the :set memmove option!

Of course you can do also binary substitutions, similar to the search command. The ability of remembering patterns like \(pattern\) is currently not implemented.

Back to the topBack to the top

Last update: Fri Jun 30 22:33:20 CEST 2000 by Gerhard Bürgmann, Purkersdorf/Austria