Bash - Pipeline

Bash Liste Des Attaques Ovh

About

This article talks about the syntax of a Shell Pipeline in Bash

All command(s) in a pipeline are executed:

  • and started in a subshell (meaning that the environment is not passed along the way)

This page talks about pipeline (e ia command that takes the output of a command as input), a succession of a command in bash is called a list

Syntax

This is the same syntax than a shell pipeline where you can add the time command

[time [-p]] pipeline]

where:

  • time print the time statistics.
  • The -p option changes the output format to that specified by posix. The TIMEFORMAT variable may be set to a format string that specifies how the timing information should be displayed.

Execution

(A)synchronous

If the pipeline is not executed asynchronously (see Lists), the shell waits for all commands in the pipeline to complete.

Parallel

Each command in a pipeline is executed as a separate process (i.e., in its own subshell). The shell waits for all commands in the pipeline to terminate before returning a value.

Exit Status

The exit status of a pipeline is the exit status of the last command in the pipeline, unless the pipefail option is enabled (see The Set Builtin).

If pipefail is enabled, the pipeline's return status is the value of the last (rightmost) command to exit with a non-zero status, or zero if all commands exit successfully.

If the reserved word ‘!’ precedes the pipeline, the exit status is the logical negation of the exit status.

Documentation / Reference





Discover More
Bash Liste Des Attaques Ovh
Bash - (Builtin|Intern|System|Reserved|Shell) variable name

Reserved variable name are named that have a special meaning for the bash shell. PS1 defines the shell's command-line prompt. HOME defines the home directory for a user. PATH defines a list...
Bash Liste Des Attaques Ovh
Bash - (Return|Exit) (Value|Status)

The return status (also known as Exit Status of Exit Code) of a simple command is its exit status as provided by: the posix 1003.1 waitpid function, or 128+n if the command was terminated by signal...
Bash Liste Des Attaques Ovh
Bash - Lists of Commands

A list of command is a sequence of one or more pipelines separated by one of the operators: ‘;’, ‘&’, ‘&&’, or ‘||’, and optionally terminated by one of ‘;’, ‘&’, or a newline....
Bash Liste Des Attaques Ovh
Bash - Read (Builtin Command) that capture a line

Read is a bash builtin command and read: by default one line or a number of characters (by option) from: the standard input, or from the file descriptor fd supplied as an argument to the...
Bash Liste Des Attaques Ovh
Bash - Set (of Bash Options)

The set builtin command can be specify shell option. When options are specified, they set or unset shell attributes. Without options, the name and value of each shell variable are displayed in a...
Bash Liste Des Attaques Ovh
Bash - While

This article is dedicated to the while syntax in Bash. where: : is the no-op command; its exit status is always 0 The command: lists the file with the ls executable (ls -l) pipe the...
Bash Liste Des Attaques Ovh
Bash - time (Execution Time Measurement)

time is a bash reserved word to print the time statistics (elapsed (wall-clock) time and user and system time. The use of time as a reserved word permits the timing of: Bash builtins, Bash functions,...
Bash Liste Des Attaques Ovh
Bash Shell and (Unix|Linux) Utilities (XCU)

Bash is: Bourne-Again shell (Os Shell). It means that this is scripting language used in a terminal based around The articles of this section are over: the Bash (Bourne-Again Shell) the...
Bash Liste Des Attaques Ovh
Shell - Parallel

Shell commands are executed in parallel in pipelines. Each command in a pipeline is executed as a separate process (i.e., in its own subshell). Command-line tools can be 235x faster than your...
Card Puncher Data Processing
Shell Data Processing - (WC|Word Count) command (Line count)

The wc command is a filter that prints on one line sequentially the number of: newlines (lines), words, and characters from: files or from an input stream when: no FILE is specified or...



Share this page:
Follow us:
Task Runner