Each dialog in the System Management Interface Tool (SMIT) builds and executes a version of a standard command. The command to be executed by the dialog is defined by the cmd_to_exec descriptor in the sm_cmd_hdr object that defines the dialog header.
In building the command defined in an sm_cmd_hdr.cmd_to_exec descriptor, SMIT uses a two-pass scan over the dialog set of sm_cmd_opt objects to collect prefix and parameter values. The parameter values collected include those that the user changed from their initially displayed values and those with the sm_cmd_opt.required descriptor set to "y".
The first pass gathers all of the values of the sm_cmd_opt objects (in order) for which the prefix descriptor is either an empty string ("") or starts with a - (a minus sign). These parameters are not position-sensitive and are added immediately following the command name, together with the contents of the prefix descriptor for the parameter.
The second pass gathers all of the values of the remaining sm_cmd_opt objects (in order) for which the prefix descriptor is -- (two dashes). These parameters are position-sensitive and are added after the flagged options collected in the first pass.
Note: SMIT executes the value of what you enter in the prefix field. If the value in the prefix field is a reserved shell character, for example, the * (asterisk), you must follow the character with a --' (dash dash single quotation mark). Then, when the system evaluates the character, it does not mistake it for a shell character.
Command parameter values in a dialog are filled in automatically when the disc_field_name descriptors of its sm_cmd_opt objects match names of values generated by preceding selectors or a preceding discovery command. These parameter values are effectively default values and are normally not added to the command line. Initializing an sm_cmd_opt.required descriptor to "y" or "+" causes these values to be added to the command line even when they are not changed in the dialog. If the sm_cmd_opt.required descriptor value is "?", the corresponding values are used only if the associated entry field is non-empty. These parameter values are built into the command line as part of the regular two-pass process.
Leading and trailing white spaces (spaces and tabs) are removed from parameter values except when the sm_cmd_opt.entry_type descriptor is set to "r". If the resulting parameter value is an empty string, no further action is taken unless the sm_cmd_opt.prefix descriptor starts with an option flag. Surrounding single quotation marks are added to the parameter value if the prefix descriptor is not set to "--" (two dashes). Each parameter is placed immediately after the associated prefix, if any, with no intervening spaces. Also, if the multi_select descriptor is set to "m", tokens separated by white space in the entry field are treated as separate parameters.
SMIT runs the command string specified in a sm_cmd_hdr.cmd_to_exec descriptor by first creating a child process. The standard error and standard output of the child process are handled as specified by the contents of the sm_cmd_hdr.exec_mode descriptor. SMIT next runs a setenv("ENV=") subroutine in the child process to prevent commands specified in the $HOME/.env file of the user from being run automatically when a new shell is invoked. Finally, SMIT calls the execl subroutine to start a ksh shell, using the command string as the ksh -c parameter value.
SMIT makes the path names of the log files and the settings of the command line verbose, trace, and debug flags available in the shell environment of the commands it runs. These values are provided with the following environment variables:
The presence or absence of the corresponding flag is indicated by a value of 0 or 1, respectively.
Additionally, the SMIT environment variable provides information about which SMIT environment is active. The SMIT environment variable can have the following vaues:
Value | SMIT Environment |
---|---|
a | SMIT in an ASCII interface |
d | SMIT in the Distributed SMIT (DSMIT) interface |
m | SMIT in a windows (also called Motif) interface |
An easy way to view the current settings is to invoke the shell function after starting SMIT and then run the command string env | grep SMIT.
You can disable the function key F9=Shell by setting the environment variable SMIT_SHELL=n.
All writes to the log files should be done as appends and should immediately be followed by flushes where this does not occur automatically.
You can override SMIT default output redirection of the (child) task process by setting the sm_cmd_hdr.exec_mode field to "i". This setting gives output management control to the task, since the task process simply inherits the standard error and standard output file descriptors.
You can cause SMIT to shutdown and replace itself with the target task by setting the sm_cmd_hdr.exec_mode field to "e".