The jsh command invokes jSHELL - the jBASE shell. It can be invoked as your login shell by using the normal system administration software supplied with the platform. Either via .bat files (Windows) or .profiles (Unix ).
jSHELL has been designed to ease migration from older systems, and to overcome some of the differences between various platform command line environments. The more primitive features seen on some older platforms (such as the "dot" command stacker) have been replaced with easier to use and more functional equivalents.
The most noticeable difference between jSHELL and other command line shells, such as the Unix Korn shell (ksh), is that command line arguments such as "*" and "?" are not expanded by the shell but passed directly to the command that has been invoked. In same manner, quoted strings (such as "quoted string") are passed directly to the command with quotes intact. This enables query language statements such as:
to be issued directly from jSHELL. If the same command was issued from the ksh prompt, it would have to be issued as:
to avoid the quotes being removed and the "*" being expanded by the Korn shell.
Beyond this convenient feature, jSHELL also offers many significant advantages over traditional shells and is easier to use. Some of the main features of the jsh are:
JSH COMMAND SYNTAX
jsh - -c command -s shell -p prompt
Note: If the jsh command is issued without arguments, a jsh process is spawned and this process becomes your command shell. The jsh process will replace the current shell if it is invoked through the UNIX exec command.
To use this tutorial you will need to be logged in to your system and positioned at the shell prompt. If your user account has not been configured to run jSHELL by default, execute it now like this:
exec jsh - [unix/Linux]
The default jSHELL prompt should now appear:
jsh user cwd -->
Where user is your login name and cwd is your current working directory. For this exercise we will assume that your login name was jbase and that your current working directory is the home directory for jBASE. In this case your prompt will look like this:
jsh jbase ~ -->
The tilde character (~) is a short-hand method of referring to your home directory. The shell expands this character to the full path name of your login home directory before executing commands. If you had changed to a sub-directory called source your prompt would now look like this:
jsh jbase ~ --> cd source
jsh jbase ~ -->set jps1 newprompt
Where newprompt is a string defining the new prompt. The string can contain terminal control characters such as a bell character by specifying special character sequences in the newprompt string. The character sequences allowed are:
The shell operates in two distinct modes, command mode and operating mode. Operating mode is the usual mode and is used to issue all commands to the system. Command mode is used to issue commands to jsh itself.
There is only one command available in the current implementation of jsh - the / command. This character introduces a search string to jsh. The search string is compared against every command in your command history and if a match is found, the command is recalled as the current command, just as if you had typed it in again. Command mode is normally entered by hitting the escape key on your keyboard.
If you include the $%m sequence when you configure the prompt, the prompt will change to indicate whether or not you are in the shell command mode. For example, if the prompt has otherwise been left in its default state, the following sequence will locate the last cd command in your command history. Note the appearance of the "(Cmd)" string as part of the prompt on the middle line:
jsh ~ --><Esc>
Two other keystrokes within jsh allow you to recall up to 50 previous commands. They are:
<Ctrl P> Goto previous command
Using these two keystrokes you can retrace your commands by stepping backwards or forwards one command at a time. If you need to change any part of a command line it is very easy as the jsh supports command line editing by using a subset of the jED editor keys.
In particular, you can use the right and left arrow keys to move the cursor to any position in the current command string. The jsh is configured for editing in insert mode by default. This means that any characters you type will be inserted just before the current cursor position. Use the backspace key to delete the previous character and the <Delete> key to delete the character directly under the cursor. Try recalling a previous command and experiment with the editing keys.
The jsh can be placed into overwrite editing mode by pressing <Ctrl O>. In this mode all characters typed will replace the character under the cursor.
All the editing commands are shown in the following table:
If you are already familiar with operating UNIX under other shells, jsh will allow you to work in the environment with which you are most comfortable. You can switch between the various emulation modes in jsh by using the function keys:
Note that some terminals may not support these function keys. If your terminal does not support the F1, F2 and F3 function keys, the emulation mode can be modified by the jsh internal command, jshelltype. The command syntax is as follows;
Where shell can be one of the following:
jsh pre-processes meta characters like the asterisk (*), as expected
by legacy multi-value systems. Note that only in jsh mode is JEDIFILENAME_MD
examined for Q-pointers, Procs and Paragraphs.
msh Mapped Sequences
Options specified on the command line will have the leading bracket escaped. For example:
CT File1 Record1 (X becomes CT File1 Record1 \(X
Any asterisk used as part of a record specification is escaped. For example:
CT File1 * becomes CT File1 \*
Quotes used in a selection criteria specification are escaped.
LIST File1 WITH A1 = "XYZ]" becomes LIST File1 WITH \*A1 = \"XYZ]\"
Other meta characters are untouched so that pipes, etc. can be invoked:
cmd | cmd cmd & vi *.c