mdsh
Shell for MX-ONE Service Node
Format
- mdsh
Function
It is possible to run different shells (that is,. command interpreters) on UNIX and Linux systems. It is normally possible to start another shell from inside a shell. The shell that is to be started when a person logs into the computer is called a “login shell”. The file /etc/passwd controls which shell is the login shell of which user.
mdsh can be started from another shell, or it can be used as login shell.
The login shell field in /etc/passwd is set by the system administrator when he/she creates the user account. The users can change the login shell themselves by the use of the chsh command. You do not usually edit /etc/passwd directly. (A skilled system administrator can edit /etc/passwd directly, but that requires great care to guarantee that no extra/erroneous characters are entered by mistake.)
It is intended that the users on the MX-ONE Service Node (that is,. the service personnel of the customer) should have mdsh as login shell. Different user accounts have different privileges in mdsh. These privileges are governed by the file /etc/opt/eri_sn/mdsh.conf.
Different privileges grant the rights to enter different commands. The command “help” in mdsh lists (only) the commands the current user is privileged to execute.
Users on the highest privilege level are allowed to start other shells from mdsh (thus bash is one of the allowed commands for this level).
There are 3 fundamentally different types of commands in mdsh:
- MML commands
These commands are syntactically different from unix commands. These commands are sent by mdsh to the program unit CIOR that looks up a registered command handler (like THH) to execute the command.
- Built-in commands
These commands are executed by mdsh, as an integrated part functionality of mdsh. Examples of such commands are "cd" and "threads". More help on these commands are available by typing "help <command name>" in mdsh. (It is possible for mdsh to provide help on these commands, as mdsh has total control over these commands.).
- Linux commands
These commands are separate executable files in the unix environment outside mdsh. mdsh has no knowledge about how these commands work. Some of these commands are standard Linux/Unix tools like "less". Other executable files are programs that belong to the MX-ONE Service Node software.
The mdsh does not support flow control statements like loops, "if" statements "while" statements, pipes and redirection. Another shell should be used if these features are needed. (bash is recommended.) (See "mdsh -c command" below.) mdsh command line switches:
- -c command
Only execute command. The command is executed directly and mdsh is terminated. There is no prompt for commands.
- -f
Turn off confirmation of dangerous commands.
- -gdsxport
pAddress:portnum: Start mdsh, but wait for GDSX to connect to the ipAddress:port. Read commands from GDSX on the port instead of prompting for commands.
- -genConf file
Generate an example configuration file.
- --help, -help, -H, -h, -?
print this help text.
Script files:
A command line argument that is not one of the above switches, should be the name of script file with mdsh commands. Further command line arguments are passed as arguments to the script file.
Initialization files:
When mdsh is started it first reads the file /etc/opt/eri_sn/mdsh.rc (if it exists) and executes the commands in this file. After that mdsh reads the file ${HOME}/.mdshrc (if it exists) and executes the commands in this file.These files are intended for setting of environment variables, etc.
The command history is saved in the file ${HOME}/.mdsh.history
Parameters
-
Example
-