github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/parser/logical-or.md (about)

     1  # `||` Or Logical Operator
     2  
     3  > Continues next operation only if previous operation fails
     4  
     5  ## Description
     6  
     7  When in the **normal** run mode (see "schedulers" link below) this will only
     8  run the command on the right hand side if the command on the left hand side
     9  does not error. Neither STDOUT nor STDERR are piped.
    10  
    11  This has no effect in `try` nor `trypipe` run modes because they automatically
    12  apply stricter error handling. See detail below.
    13  
    14  
    15  
    16  ## Examples
    17  
    18  **Second command does not run because the first command doesn't error:**
    19  
    20  ```
    21  » out one || out two
    22  one
    23  ```
    24  
    25  **Second command does run because the first command produces an error:**
    26  
    27  ```
    28  » err one || out two
    29  one
    30  two
    31  ```
    32  
    33  ## Detail
    34  
    35  This has no effect in `try` nor `trypipe` run modes because they automatically
    36  apply stricter error handling. You can achieve a similar behavior in `try` with
    37  the following code:
    38  
    39  ```
    40  try {
    41      err one -> !if { out two }
    42  }
    43  ```
    44  
    45  There is no workaround for `trypipe`.
    46  
    47  ## See Also
    48  
    49  * [Pipeline](../user-guide/pipeline.md):
    50    Overview of what a "pipeline" is
    51  * [Schedulers](../user-guide/schedulers.md):
    52    Overview of the different schedulers (or 'run modes') in Murex
    53  * [`&&` And Logical Operator](../parser/logical-and.md):
    54    Continues next operation if previous operation passes
    55  * [`?:` Elvis Operator](../parser/elvis.md):
    56    Returns the right operand if the left operand is falsy (expression)
    57  * [`?` STDERR Pipe](../parser/pipe-err.md):
    58    Pipes STDERR from the left hand command to STDIN of the right hand command (DEPRECATED)
    59  * [`err`](../commands/err.md):
    60    Print a line to the STDERR
    61  * [`out`](../commands/out.md):
    62    Print a string to the STDOUT with a trailing new line character
    63  * [`try`](../commands/try.md):
    64    Handles non-zero exits inside a block of code
    65  * [`trypipe`](../commands/trypipe.md):
    66    Checks for non-zero exits of each function in a pipeline
    67  
    68  <hr/>
    69  
    70  This document was generated from [gen/parser/logical_ops_doc.yaml](https://github.com/lmorg/murex/blob/master/gen/parser/logical_ops_doc.yaml).