ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahz_5.4.0.1/cmdcl.htm

96 lines
3.0 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8">
<title>Running Qshell commands from CL</title>
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</HEAD>
<body bgcolor="#FFFFFF">
<!-- Java sync-link -->
<SCRIPT LANGUAGE="Javascript" SRC="../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
<p></p>
<h2>Running Qshell commands from CL</h2>
<p>The Start QSH (STRQSH) command, also known as QSH, is a CL
(control language) command that either starts a Qshell interactive
session or runs a Qshell command.</p>
<p>If called with the CMD parameter, STRQSH runs the specified
Qshell command. The possible values of the CMD parameter are:</p>
<dl>
<dt><strong>*NONE</strong></dt>
<dd>No command is provided and an <a href="commands.htm">interactive session</a> is started.
If CMD(*NONE) is specified and STRQSH is run in a batch job, STRQSH
does nothing.</dd>
<dt><strong>command</strong></dt>
<dd>A Qshell 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.</dd>
</dl>
<p>When running a command, STRQSH starts <strong>qsh</strong>, runs
the specified Qshell command, displays any output generated by the
command to the C runtime terminal session, and ends <strong>
qsh</strong>. Note that <strong>qsh</strong> does not run any
profile files when started to run a command.</p>
<p>You can control what happens to the output by setting the
QIBM_QSH_CMD_OUTPUT environment variable. The environment variable
can have these values:</p>
<dl>
<dt><strong>STDOUT</strong></dt>
<dd>Display the output to the C runtime terminal session. This is
the default value.</dd>
<dt><strong>NONE</strong></dt>
<dd>Throw away any output that is produced.</dd>
<dt><strong>FILE=pathname</strong></dt>
<dd>Store the output in the file specified by pathname. The file is truncated
before output is written to the file.</dd>
<dt><strong>FILEAPPEND=pathname</strong></dt>
<dd>Store the output in the file specified by pathname. The output is appended
to end of the file.</dd>
</dl>
<p>When the command ends, STRQSH sends one of three messages:</p>
<ul>
<li>QSH0005 when the process running the command ends normally. The
message includes the exit status of the process.</li>
<li>QSH0006 when the process running the command ends by signal.
The message includes the signal number.</li>
<li>QSH0007 when the process running the command ends by
exception.</li>
</ul>
<p>By default, the messages are sent as completion messages. You
can have the messages sent as escape messages by setting the
environment variable QIBM_QSH_CMD_ESCAPE_MSG. When the value of the
environment variable is "Y", the QSH0006, and QSH0007 messages are
always sent as escape messages and the QSH0005 message is sent as
an escape message if the exit status is greater than zero.
</p>
</body>
</html>