EDIT command
The EDIT command launches an editing tool that you specify and runs commands created in the editing tool in CLP interactive mode. Once you create a command, save it, and close the specified editor, the EDIT command then runs the command.
Scope
This command can only be run within CLP interactive mode. Specifically, it cannot be run from the CLP command mode or the CLP batch mode.
Authorization
None
Required connection
None
Command syntax
Command parameters
- EDITOR
- Launch the editor specified for editing. If this parameter is
not specified, the editor to be used is determined in the following
order:
- the editor specified by the DB2_CLP_EDITOR registry variable
- the editor specified by the VISUAL environment variable
- the editor specified by the EDITOR environment variable
- On Windows operating systems, the Notepad editor; on UNIX operating systems, the vi editor
- num
- If num is positive, launches the editor with the command corresponding to num. If num is negative, launches the editor with the command corresponding to num, counting backwards from the most recent command in the command history. Zero is not a valid value for num. If this parameter is not specified, launches the editor with the most recently run command. (This is equivalent to specifying a value of -1 for num.)
Usage notes
- The editor specified must be a valid editor contained in the PATH of the operating system.
- You can view a list of the most recently run commands available for editing by executing the HISTORY command.
- The EDIT command will never be recorded in the command history. However, if you choose to run a command that was edited using the EDIT command, this command will be recorded in the command history.