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

83 lines
2.8 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>Lists</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>
<h2>Lists</h2>
<p>A list is a sequence of commands separated by an ampersand
(<strong>&amp;</strong>) or a semicolon (<strong>;</strong>), and
optionally terminated by a &lt;newline&gt;, ampersand, or
semicolon. An AND-OR list is a sequence of commands separated by a
<strong>&amp;&amp;</strong> or <strong>||</strong>. Both operators
have the same priority.</p>
<p><strong>Asynchronous lists</strong></p>
<p>If a command is terminated by the control operator ampersand
(<strong>&amp;</strong>), <strong>qsh</strong> runs the command
asynchronously. That is, <strong>qsh</strong> does not wait for the
command to finish before running the next command. The format for
running a command in the background is:</p>
<p><em>command1</em> <strong>&amp;</strong> [ <em>command2</em>
<strong>&amp;</strong> ... ]</p>
<p>If the interactive option is not set, the standard input of any
asynchronous command is set to /dev/qsh-stdin-null. The exit status
of an asynchronous list is the exit status of the last <em>
command</em>.</p>
<p><strong>Sequential lists</strong></p>
<p>Commands that are separated by a semicolon (<strong>;</strong>)
are run sequentially. The format for a sequential list is:</p>
<p><em>command1</em> [ <strong>;</strong> <em>command2</em> ...
]</p>
<p>The commands in the list are run in the order they are written.
The exit status of a sequential list is the exit status of the last
<em>command</em>.</p>
<p><strong>AND lists</strong></p>
<p>The format for an AND list is:</p>
<p><em>command1</em> [ <strong>&amp;&amp;</strong> <em>
command2</em> ... ]</p>
<p>With an AND list, <strong>qsh</strong> runs <em>command1</em>,
and then runs <em>command2</em> if the exit status of the <em>
command1</em> is zero and so on until a command has a non-zero exit
status or there are no commands left to run. The exit status of an
AND list is the exit status of the last <em>command</em> that is
run.</p>
<p><strong>OR lists</strong></p>
<p>The format for an OR list is:</p>
<p><em>command1</em> [ <strong>||</strong> <em>command2</em> ...
]</p>
<p>With an OR list, <strong>qsh</strong> runs <em>command1</em>,
and then runs <em>command2</em> if the exit status of the <em>
command1</em> is non-zero and so on until a command has a zero exit
status or there are no commands left to run. The exit status of an
OR list is the exit status of the last <em>command</em> that is
run.</p>
</body>
</html>