What is Bash Process Substitution? (Expansion)

Bash Liste Des Attaques Ovh

About

On systems that can support it, there is an additional expansion available: process substitution

A list is run asynchronously, and its input or output appears as a filename (ie file path)

  • If the >(list) form is used, writing to the file will provide input for list.
  • If the <(list) form is used, the file passed as an argument should be read to obtain the output of list.

Example

Pass a list as filename/path argument <(list) form

It permits to pass a string as a file path.

Example: If the cli script expect only a path (ie a file descriptor), you can still give it generated content like that:

script <(echo "Content")

Example >(list) form

echo test | tee >(cat) >/dev/null

Note

When using process substitution, bash creates the file descriptor at /dev/fd/x such as /dev/fd/63





Discover More
Bash Liste Des Attaques Ovh
Bash - (Argument|Positional Parameter)

An argument is a parameter given: to a command to a function or to the bash shell They are referenced by position. A positional parameter is a parameter denoted: by one or more digits, ...
Bash Liste Des Attaques Ovh
Bash - Case

The case control statement execute commands based on regular expression pattern matching. Initscript example: Selectively execute COMMANDS based upon WORD matching glob PATTERN. The | is used to...
Bash Liste Des Attaques Ovh
Bash - Expansion

This article is expansion in Bash. An expansion is the replacement of a special token in your code by the result of the expansion during code execution. It's performed on the command line after it has...
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...



Share this page:
Follow us:
Task Runner