Fix redundancy. While here, correct usage of unix and tighten wording.
Sponsored by: Essen Devsummit Hackathon
This commit is contained in:
parent
9d8db2d90d
commit
a91359e94e
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=47085
1 changed files with 20 additions and 22 deletions
|
|
@ -3178,14 +3178,14 @@ Swap: 2048M Total, 2048M Free
|
|||
<para>Shell redirection is the action of sending the output or
|
||||
the input of a command into another command or into a file.
|
||||
To capture the output of the &man.ls.1; command, for example,
|
||||
into a file, simply redirect the output:</para>
|
||||
into a file, redirect the output:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>ls > directory_listing.txt</userinput></screen>
|
||||
|
||||
<para>The <filename>directory_listing.txt</filename> file will
|
||||
now contain the directory contents. Some commands allow you
|
||||
to read input in a similar one, such as &man.sort.1;. To sort
|
||||
this listing, redirect the input:</para>
|
||||
<para>The directory contents will now be listed in
|
||||
<filename>directory_listing.txt</filename>. Some commands can
|
||||
be used to read input, such as &man.sort.1;. To sort this
|
||||
listing, redirect the input:</para>
|
||||
|
||||
<screen>&prompt.user; <userinput>sort < directory_listing.txt</userinput></screen>
|
||||
|
||||
|
|
@ -3196,26 +3196,24 @@ Swap: 2048M Total, 2048M Free
|
|||
<screen>&prompt.user; <userinput>sort < directory_listing.txt > sorted.txt</userinput></screen>
|
||||
|
||||
<para>In all of the previous examples, the commands are
|
||||
performing redirection using file descriptors. Every unix
|
||||
system has file descriptors; however, here we will focus on
|
||||
three, so named as Standard Input, Standard Output, and
|
||||
Standard Error. Each one has a purpose, where input could be
|
||||
a keyboard or a mouse, something that provides input. Output
|
||||
could be a screen or paper in a printer for example. And
|
||||
error would be anything that is used for diagnostic or error
|
||||
messages. All three are considered <acronym>I/O</acronym>
|
||||
based file descriptors and sometimes considered
|
||||
streams.</para>
|
||||
performing redirection using file descriptors. Every &unix;
|
||||
system has file descriptors, which include standard input
|
||||
(stdin), standard output (stdout), and standard error
|
||||
(stderr). Each one has a purpose, where input could be a
|
||||
keyboard or a mouse, something that provides input. Output
|
||||
could be a screen or paper in a printer. And error would be
|
||||
anything that is used for diagnostic or error messages. All
|
||||
three are considered <acronym>I/O</acronym> based file
|
||||
descriptors and sometimes considered streams.</para>
|
||||
|
||||
<para>Through the use of these descriptors, short named stdin,
|
||||
stdout, and stderr, the shell allows output and input to be
|
||||
passed around through various commands and redirected to or
|
||||
from a file. Another method of redirection is the pipe
|
||||
operator.</para>
|
||||
<para>Through the use of these descriptors, the shell allows
|
||||
output and input to be passed around through various commands
|
||||
and redirected to or from a file. Another method of
|
||||
redirection is the pipe operator.</para>
|
||||
|
||||
<para>The &unix; pipe operator, <quote>|</quote> allows the
|
||||
output of one command to be directly passed, or directed to
|
||||
another program. Basically a pipe will allow the standard
|
||||
output of one command to be directly passed or directed to
|
||||
another program. Basically, a pipe allows the standard
|
||||
output of a command to be passed as standard input to another
|
||||
command, for example:</para>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue