83 lines
2.8 KiB
HTML
83 lines
2.8 KiB
HTML
|
<!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>&</strong>) or a semicolon (<strong>;</strong>), and
|
||
|
optionally terminated by a <newline>, ampersand, or
|
||
|
semicolon. An AND-OR list is a sequence of commands separated by a
|
||
|
<strong>&&</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>&</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>&</strong> [ <em>command2</em>
|
||
|
<strong>&</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>&&</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>
|
||
|
|