Start QSH (STRQSH)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Start QSH (STRQSH) command, as known as QSH, starts the qsh shell interpreter.

If run in an interactive job, STRQSH starts an interactive shell session. If a shell session is not already active in the job, then:

  1. A new shell session is started and a terminal window is displayed.
  2. qsh runs the commands from the file /etc/profile if it exists.
  3. qsh runs the commands from the file .profile in the user's home directory if it exists.
  4. qsh runs the commands from the file specified by the expansion of the ENV variable if it exists.

If a shell session is already active in an interactive job, you are reconnected to the existing session. From the terminal window, you can enter shell commands and view output from the commands.

Using the Terminal Window

The terminal window has two parts:

The terminal window supports the following function keys:

F3 (Exit)
Close the terminal window and end the qsh session.
F5 (Refresh)
Refresh the output area.
F6 (Print)
Print the output area to a spool file.
F7 (Up)
Roll output area up one page.
F8 (Down)
Roll output area down one page.
F9 (Retrieve)
Retrieve a previous command. You can press this key multiple times to retrieve any previous command. For example, to retrieve the second to last command you entered, press this key two times. You can also select a specific command to be run again by placing the cursor on that command and pressing this key. When the interactive job is running in a double-byte CCSID, this key is not available.
F11 (Toggle line wrap)
Toggle the line wrap/truncate mode in the output area. In line wrap mode, lines longer than the width of the terminal window are wrapped to the next line. In truncate mode, the portion of a line beyond the width of the terminal window is not shown.
F12 (Disconnect)
Disconnect from the qsh session. This key only closes the terminal window and does not end the qsh session. You can redisplay the disconnected qsh session by running STRQSH again.
F13 (Clear)
Clear the output area.
F17 (Top)
Display top of output area.
F18 (Bottom)
Display bottom of output area.
F19 (Left)
Shift output area to the left.
F20 (Right)
Shift output area to the right.
F21 (CL command entry)
Display a command entry window where you can enter CL commands.

Also, you can use SysReq 2 to interrupt the currently running command.

Error messages for STRQSH

*ESCAPE Messages

QSH0002
Error found with QSH session, reason code &1, errno &2.
Top

Parameters

Keyword Description Choices Notes
CMD Command Character value, *NONE Optional
Top

Command (CMD)

Specifies the shell command to be run.

The possible values are:

*NONE:
No command is provided and an interactive session is started.
command
A shell command to run. The command can be a maximum of 5000 bytes in length. If a blank or other special characters are used, the command must be enclosed in apostrophes ('). If an apostrophe is intended, two apostrophes must be used ('').

Note: The case is preserved when lowercase characters are specified.

Top

Examples

None
Top

Error messages

*ESCAPE Messages

QSH0002
Error found with QSH session, reason code &1, errno &2.
Top