56 lines
2.0 KiB
HTML
56 lines
2.0 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>Pipelines</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>Pipelines</h2>
|
|
|
|
<p>A pipeline is a sequence of one or more commands separated by
|
|
the pipeline control operator (<strong>|</strong>). The standard
|
|
output of all but the last command is connected to the standard
|
|
input of the next command.</p>
|
|
|
|
<p>The format for a pipeline is:</p>
|
|
|
|
<p><strong>[ ! ]</strong> <em>command1</em> [ <strong>|</strong>
|
|
<em>command2</em> ... ]</p>
|
|
|
|
<p>The standard output of <em>command1</em> is connected to the
|
|
standard input of <em>command2</em>. The standard input, standard
|
|
output, or both of a command is considered to be assigned by the
|
|
pipeline before any redirection specified by redirection operators
|
|
that are part of the command. The exit status of the pipeline is
|
|
the exit status of the last <em>command</em>.</p>
|
|
|
|
<p>If the pipeline is not in the background (described below),
|
|
<strong>qsh</strong> waits for all commands to complete.</p>
|
|
|
|
<p>If the reserved word <strong>!</strong> does not precede the
|
|
pipeline, the exit status is the exit status of the last command
|
|
specified in the pipeline. Otherwise, the exit status is the
|
|
logical not of the exit status of the last command. That is, if the
|
|
last command returns zero, the exit status is 1; if the last
|
|
command returns greater than zero, the exit status is zero.</p>
|
|
|
|
<p>Because pipeline assignment of standard input or standard output
|
|
or both takes place before redirection, it can be modified by
|
|
redirection. For example:</p>
|
|
|
|
<p>command1 2>&1 | command2</p>
|
|
|
|
<p>sends both the standard output and standard error of <em>
|
|
command1</em> to the standard input of <em>command2</em>.</p>
|
|
</body>
|
|
</html>
|
|
|