Using the Edit Command
A VI-like editor is available on the switch to edit policies. There are many commands available with the editor. For information about the editor commands, use any tutorial or documentation about VI. The following is only a short introduction to the editor.
The editor operates in one of two modes: command and input.
To edit a policy file on the switch by launching the
editor, enter the command:
edit policy filename.polWhen a file first opens, you are in the command mode.
To write in the file, use the keyboard arrow keys to
position your cursor within the file, then press one of the following
keys to enter input mode:
- [i]—Inserts text ahead of the initial cursor position.
- [a]—Appends text after the initial cursor position.
- To escape the input mode and return to the command mode, press the [Esc] key.
- [dd]—Deletes the current line.
- [yy]—Copies the current line.
- [p]—Pastes the line copied.
- [:w]—Writes (saves) the file.
- [:q]—Quits the file if no changes were made.
- [:q!]—Forcefully quits the file without saving changes.
- [:wq]—Writes and quits the file.