The script editor, nvedit, lets you create and modify the script using the commands listed in Table 3-5.
Table 3-5 Commands Affecting NVRAMAC
Command |
Description |
---|---|
nvalias alias device-path |
Stores the command "devalias alias device-path" in the script. The alias persists until either nvunalias or set-defaults is executed. |
$nvalias |
Performs the same function as nvalias except that it takes its arguments, name-string and device-string, from the stack. |
nvedit |
Enters the script editor. If data remains in the temporary buffer from a previous nvedit session, resumes editing those previous contents. If not, reads the contents of nvramrc into the temporary buffer and begins editing it. |
nvquit |
Discards the contents of the temporary buffer, without writing it to nvramrc. Prompts for confirmation. |
nvrecover |
Recovers the contents of nvramrc if they have been lost as a result of the execution of set-defaults; then enters the editor as with nvedit. nvrecover fails if nvedit is executed between the time that the nvramrc contents were lost and the time that nvrecover is executed. |
nvrun |
Executes the contents of the temporary buffer. |
nvstore |
Copies the contents of the temporary buffer to nvramrc; discards the contents of the temporary buffer. |
nvunalias alias |
Deletes the specified alias from nvramrc. |
$nvunalias |
Performs the same function as nvunalias except that it takes its argument, name-string, from the stack. |
The editing commands shown in Table 3-6 are used in the script editor.
Table 3-6 Script Editor Keystroke Commands
Keystroke |
Description |
---|---|
Control-B |
Moves backward one character. |
Escape B |
Moves backward one word. |
Control-F |
Moves forward one character. |
Escape F |
Moves forward one word. |
Control-A |
Moves backward to beginning of the line. |
Control-E |
Moves forward to end of the line. |
Control-N |
Moves to the next line of the script editing buffer. |
Control-P |
Moves to the previous line of the script editing buffer. |
Return (Enter) |
Inserts a new line at the cursor position and advances to the next line. |
Control-O |
Inserts a newline at the cursor position and stays on the current line. |
Control-K |
Erases from the cursor position to the end of the line, storing the erased characters in a save buffer. If at the end of a line, joins the next line to the current line (i.e. deletes the newline). |
Delete |
Erases the previous character. |
Backspace |
Erases the previous character. |
Control-H |
Erases the previous character. |
Escape H |
Erases from beginning of word to just before the cursor, storing erased characters in a save buffer. |
Control-W |
Erases from beginning of word to just before the cursor, storing erased characters in a save buffer. |
Control-D |
Erases the next character. |
Escape D |
Erases from the cursor to the end of the word, storing the erased characters in a save buffer. |
Control-U |
Erases the entire line, storing the erased characters in a save buffer. |
Control-Y |
Inserts the contents of the save buffer before the cursor. |
Control-Q |
Quotes the next character (i.e. allows you to insert control characters). |
Control-R |
Retypes the line. |
Control-L |
Displays the entire contents of the editing buffer. |
Control-C |
Exits the script editor, returning to the OpenBoot command interpreter. The temporary buffer is preserved, but is not written back to the script. (Use nvstore afterwards to write it back.) |