File: subproc_types.rst

package info (click to toggle)
xonsh 0.13.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,024 kB
  • sloc: python: 46,350; makefile: 136; sh: 41; xml: 17
file content (46 lines) | stat: -rw-r--r-- 1,259 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.. _subproc_types:

**********************
Subprocess Types Table
**********************
Xonsh has a few different ways to launch subprocesses, each with their own
unique interface depending on your need. The following table is a quick reference
for the different suprocesses. The columns have the following meaning:

:Type: The syntax for an example subprocess ``cmd``.
:Output: Whether the output is streamed to stdout/stderr.  If "captured", the output is
    not streamed as the ``cmd`` runs. If "uncaptured", the output is streamed.
:Returns: The type of the object returned by the subprocess executions. For example,
    if you were to run ``p = $(cmd)``, the return column gives the type of ``p``.
:Notes: Any comments about the subprocess.

.. list-table::
    :header-rows: 1
    :align: center

    * - Type
      - Output
      - Returns
      - Notes
    * - ``cmd``
      - Uncaptured
      - ``HiddenCommandPipeline``
      - The same as ``![cmd]``
    * - ``![cmd]``
      - Uncaptured
      - ``HiddenCommandPipeline``
      -
    * - ``$[cmd]``
      - Uncaptured
      - ``None``
      -
    * - ``!(cmd)``
      - Captured
      - ``CommandPipeline``
      -
    * - ``$(cmd)``
      - Captured
      - ``str``
      - stdout is returned