Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
C shell
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Piping ==== Commands can be connected using a pipe, which causes the output of one command to be fed into the input of the next. Both commands run [[Concurrency (computer science)|concurrently]]. *<code>|</code> means connect stdout to stdin of the next command. Errors still come to the shell window. *<code>|&</code> means connect both stdout and stderr to stdin of the next command. Running concurrently means "in parallel". In a [[Multi-core processor|multi-core]] (multiple processor) system, the piped commands may literally be executing at the same time, otherwise the [[Scheduling (computing)|scheduler]] in the operating system [[Time slice|time-slices]] between them. Given a command, e.g., "<code>a | b</code>", the shell creates a [[pipeline (computing)|pipe]], then starts both <code>a</code> and <code>b</code> with stdio for the two commands redirected so that <code>a</code> writes its stdout into the input of the pipe while <code>b</code> reads stdin from the output of the pipe. Pipes are implemented by the operating system with a certain amount of buffering so that <code>a</code> can write for a while before the pipe fills but once the pipe fills any new write will block inside the OS until <code>b</code> reads enough to unblock new writes. If <code>b</code> tries to read more data than is available, it will block until <code>a</code> has written more data or until the pipe closes, e.g., if <code>a</code> exits.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
C shell
(section)
Add topic