sh(1): Clarify subshells/processes for pipelines.
For multi-command pipelines, 1. all commands are direct children of the shell (unlike the original Bourne shell) 2. all commands are executed in a subshell (unlike the real Korn shell) MFC after: 1 week
This commit is contained in:
parent
9fa5f4a093
commit
f1ec058177
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213926
18
bin/sh/sh.1
18
bin/sh/sh.1
@ -32,7 +32,7 @@
|
|||||||
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
|
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd September 10, 2010
|
.Dd October 16, 2010
|
||||||
.Dt SH 1
|
.Dt SH 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -736,6 +736,13 @@ both of a command is considered to be assigned by the
|
|||||||
pipeline before any redirection specified by redirection
|
pipeline before any redirection specified by redirection
|
||||||
operators that are part of the command.
|
operators that are part of the command.
|
||||||
.Pp
|
.Pp
|
||||||
|
Note that unlike some other shells,
|
||||||
|
.Nm
|
||||||
|
executes each process in a pipeline with more than one command
|
||||||
|
in a subshell environment and as a child of the
|
||||||
|
.Nm
|
||||||
|
process.
|
||||||
|
.Pp
|
||||||
If the pipeline is not in the background (discussed later),
|
If the pipeline is not in the background (discussed later),
|
||||||
the shell waits for all commands to complete.
|
the shell waits for all commands to complete.
|
||||||
.Pp
|
.Pp
|
||||||
@ -773,15 +780,6 @@ to be executed sequentially;
|
|||||||
an
|
an
|
||||||
.Ql &
|
.Ql &
|
||||||
causes asynchronous execution of the preceding AND-OR-list.
|
causes asynchronous execution of the preceding AND-OR-list.
|
||||||
.Pp
|
|
||||||
Note that unlike some other shells,
|
|
||||||
.Nm
|
|
||||||
executes each process in the pipeline as a child of the
|
|
||||||
.Nm
|
|
||||||
process.
|
|
||||||
Shell built-in commands are the exception to this rule.
|
|
||||||
They are executed in the current shell, although they do not affect its
|
|
||||||
environment when used in pipelines.
|
|
||||||
.Ss Background Commands (&)
|
.Ss Background Commands (&)
|
||||||
If a command is terminated by the control operator ampersand
|
If a command is terminated by the control operator ampersand
|
||||||
.Pq Ql & ,
|
.Pq Ql & ,
|
||||||
|
Loading…
Reference in New Issue
Block a user