github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/core/io/echo_doc.yaml (about)

     1  - DocumentID: out
     2    Title: >+
     3      `out`
     4    CategoryID: commands
     5    Summary: >-
     6      Print a string to the STDOUT with a trailing new line character
     7    Description: |-
     8      Write parameters to STDOUT with a trailing new line character.
     9    Usage: |-
    10      ```
    11      out string to write -> <stdout>
    12      ```
    13    Examples: |-
    14      ```
    15      » out Hello, World!
    16      Hello, World!
    17      ```
    18  
    19      For compatibility with other shells, `echo` is also supported:
    20  
    21      ```
    22      » echo Hello, World!
    23      Hello, World!
    24      ```
    25    Detail: |-
    26      `out` / `echo` output as `string` data-type. This can be changed by casting
    27      (`cast`) or using the `tout` function.
    28  
    29      ### ANSI Constants
    30  
    31      `out` supports ANSI constants.
    32    Synonyms:
    33      - out
    34      - echo
    35    Related:
    36      - tout
    37      - err
    38      - brace-quote-func
    39      - cast
    40      - greater-than
    41      - greater-than-greater-than
    42      - pt
    43      - read
    44      - tread
    45      - ansi
    46  
    47  - DocumentID: tout
    48    Title: >+
    49      `tout`
    50    CategoryID: commands
    51    Summary: >-
    52      Print a string to the STDOUT and set it's data-type
    53    Description: |-
    54      Write parameters to STDOUT without a trailing new line character. Cast the
    55      output's data-type to the value of the first parameter.
    56    Usage: |-
    57      ```
    58      tout data-type "string to write" -> <stdout>
    59      ```
    60    Examples: |-
    61      ```
    62      » tout json { "Code": 404, "Message": "Page not found" } -> pretty
    63      {
    64          "Code": 404,
    65          "Message": "Page not found"
    66      }
    67      ```
    68    Detail: |-
    69      `tout` supports ANSI constants.
    70  
    71      Unlike `out`, `tout` does not append a carriage return / line feed.
    72    Synonyms:
    73    Related:
    74      - out
    75      - err
    76      - brace-quote-func
    77      - cast
    78      - pretty
    79      - format
    80      - ansi
    81  
    82  - DocumentID: brace-quote-func
    83    Title: >+
    84      `(brace quote)`
    85    CategoryID: parser
    86    Summary: >-
    87      Write a string to the STDOUT without new line (deprecated)
    88    Description: |-
    89      Write parameters to STDOUT (does not include a new line)
    90    Usage: |-
    91      ```
    92      (string to write) -> <stdout>
    93      ```
    94    Examples: |-
    95      ```
    96      » (Hello, World!)
    97      Hello, World!
    98  
    99      » (Hello,\nWorld!)
   100      Hello,
   101      World!
   102  
   103      » ((Hello,) (World!))
   104      (Hello,) (World!)
   105  
   106      # Print "Hello, World!" in red text
   107      » {RED}Hello, World!{RESET}
   108      Hello, World!
   109      ```
   110    Detail: |-
   111      The `(` function performs exactly like the `(` token for quoting so you do not
   112      need to escape other tokens (eg single / double quotes, `'`/`"`, nor curly
   113      braces, `{}`). However the braces are nestable so you will need to escape those
   114      characters if you don't want them nested.
   115  
   116      ### ANSI Constants
   117  
   118      `(` supports ANSI constants.
   119    Synonyms:
   120      - (
   121    Related:
   122      - tout
   123      - err
   124      - out
   125      - cast
   126      - greater-than
   127      - greater-than-greater-than
   128      - pt
   129      - ansi
   130  
   131  - DocumentID: err
   132    Title: >+
   133      `err`
   134    CategoryID: commands
   135    Summary: >-
   136      Print a line to the STDERR
   137    Description: |-
   138      Write parameters to STDERR with a trailing new line character.
   139    Usage: |-
   140      ```
   141      err string to write -> <stderr>
   142      ```
   143    Examples: |-
   144      ```
   145      » err Hello, World!
   146      Hello, World!
   147      ```
   148    Detail: |-
   149      `err` outputs as `string` data-type. This can be changed by casting
   150  
   151      ```
   152      err { "Code": 404, "Message": "Page not found" } ? cast json
   153      ```
   154  
   155      However passing structured data-types along the STDERR stream is not recommended
   156      as any other function within your code might also pass error messages along the
   157      same stream and thus taint your structured data. This is why Murex does not
   158      supply a `tout` function for STDERR. The recommended solution for passing
   159      messages like these which you want separate from your STDOUT stream is to create
   160      a new Murex named pipe.
   161  
   162      ```
   163      » pipe --create messages
   164      » bg { <messages> -> pretty }
   165      » tout <messages> json { "Code": 404, "Message": "Page not found" }
   166      » pipe --close messages
   167      {
   168          "Code": 404,
   169          "Message": "Page not found"
   170      }
   171      ```
   172  
   173      ### ANSI Constants
   174  
   175      `err` supports ANSI constants.
   176    Synonyms:
   177    Related:
   178      - tout
   179      - out
   180      - brace-quote-func
   181      - cast
   182      - bg
   183      - pipe
   184      - pretty
   185      - greater-than
   186      - greater-than-greater-than
   187      - pt
   188      - ansi
   189      - namedpipe