sh
The sh command is the builtin command shell.
Command Format
The sh command is a built-in function and can not be invoked from the command line.
Functional description
The sh command is not user invoked command but is implicitly run as the command shell when PMON2000 enters interactive mode.
Command prompt
When the command shell is ready to execute a new command it outputs the default command prompt:
PMON>
The user can change the string output as the prompt by setting the environment variable prompt to the desired string value.
PMON> set prompt "My very own pmon prompt> "
My very own pmon prompt>
The metacharacter '!', when used in the prompt string, will be replaced with the command history number assigned to the next command
Command line editor
PMON2000 have a built in command line editor which can be used to edit the command line while typing. It can also be used to edit a previously entered command and reissue it in its edited version. See the hi command for information about command history.
The edit commands are:
| up-arrow or ^P | Recall the previous command. Typing repeated up-arrow or ^P's recalls the next command from the command history. |
| down-arrow or ^N | Recall the next command. Typing repeated down arrow or ^N's recalls the next command from the command history. |
| !str | Recall the first occurence of command starting with str from the command history and execute it. |
| !num | Recall the command numbered num from the command history and execute it. |
| !! | Recall the last command from the command history and execute it. |
| <cr> | Repeat the last command if repeateable. See rptcmd. |
| right-arrow or ^F | Move the cursor forward one position |
| left-arrow or ^B | Move the cursor bacwards one position |
| 'home' or ^A | Move the cursor to the beginning |
| 'end' or ^E | Move the cursor to the end |
| ^D | Delete the character under the cursor |
| ^H | Delete the character before the cursor |
Variable substitution
When entering commands, environment variables can be called by typing their name preceded by a $ sign. Variable names may be enclosed in {} to make them stand out. This is useful to get expansion of ${myvar}foo to work properly while $myvarfoo will not expand. Also if the variable name contains other characters than A-Z, a-z and 0-9 it must be enclosed in {}.
To input a $ sign without expansion $$ should be typed.
The maximum length a command line is allowed to expanded to is limited to 512 characters.
Variable substitution can not be nested in the current version of PMON2000.
Multiple commands
More than one command can be entered on one command line by separating them with a semicolon character. This is useful when setting a variable to execute a sequence of commands. Example:
PMON> set mycmd "boot boothost:myprog; b testfunc; g start"
PMON> $mycmd
Note that the quote characters ' and " will cause the the embedded string to be treated as a single entity. However one level of quotes will be stripped of each time the string is evaluated.
Aborting a command
Typing ^C aborts the current command and returns to the PMON2000 shell prompt. Note that this is also the case if PMON2000s I/O routines are used for input and output in separately executed program.
Environment
The command uses several environment variables which control the behaviour of the command shell. See the environment manual section.
See Also
The more, hi and set commands.
The environment and expression reference on environment usage and expression construction.

