github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/commands/fexec.md (about)

     1  # `fexec` 
     2  
     3  > Execute a command or function, bypassing the usual order of precedence.
     4  
     5  ## Description
     6  
     7  `fexec` allows you to execute a command or function, bypassing the usual order
     8  of precedence.
     9  
    10  ## Usage
    11  
    12  ```
    13  fexec flag command [ parameters... ] -> <stdout>
    14  ```
    15  
    16  ## Examples
    17  
    18  ```
    19  fexec private /source/builtin/autocomplete.alias
    20  ```
    21  
    22  ## Flags
    23  
    24  * `builtin`
    25      Execute a Murex builtin
    26  * `function`
    27      Execute a Murex public function
    28  * `help`
    29      Display help message
    30  * `private`
    31      Execute a Murex private function
    32  
    33  ## Detail
    34  
    35  ### Order of precedence
    36  
    37  There is an order of precedence for which commands are looked up:
    38  
    39  1. `runmode`: this is executed before the rest of the script. It is invoked by
    40     the pre-compiler forking process and is required to sit at the top of any
    41     scripts.
    42  
    43  1. `test` and `pipe` functions also alter the behavior of the compiler and thus
    44     are executed ahead of any scripts.
    45  
    46  4. private functions - defined via `private`. Private's cannot be global and
    47     are scoped only to the module or source that defined them. For example, You
    48     cannot call a private function directly from the interactive command line
    49     (however you can force an indirect call via `fexec`).
    50  
    51  2. Aliases - defined via `alias`. All aliases are global.
    52  
    53  3. Murex functions - defined via `function`. All functions are global.
    54  
    55  5. Variables (dollar prefixed) which are declared via `global`, `set` or `let`.
    56     Also environmental variables too, declared via `export`.
    57  
    58  6. globbing: however this only applies for commands executed in the interactive
    59     shell.
    60  
    61  7. Murex builtins.
    62  
    63  8. External executable files
    64  
    65  You can override this order of precedence via the `fexec` and `exec` builtins.
    66  
    67  ### Compatibility with POSIX
    68  
    69  For compatibility with traditional shells like Bash and Zsh, `builtin` is an
    70  alias to `fexec builtin`
    71  
    72  ## Synonyms
    73  
    74  * `fexec`
    75  * `builtin`
    76  
    77  
    78  ## See Also
    79  
    80  * [`alias`](../commands/alias.md):
    81    Create an alias for a command
    82  * [`autocomplete`](../commands/autocomplete.md):
    83    Set definitions for tab-completion in the command line
    84  * [`bg`](../commands/bg.md):
    85    Run processes in the background
    86  * [`builtins`](../commands/runtime.md):
    87    Returns runtime information on the internal state of Murex
    88  * [`event`](../commands/event.md):
    89    Event driven programming for shell scripts
    90  * [`exec`](../commands/exec.md):
    91    Runs an executable
    92  * [`fg`](../commands/fg.md):
    93    Sends a background process into the foreground
    94  * [`function`](../commands/function.md):
    95    Define a function block
    96  * [`jobs`](../commands/fid-list.md):
    97    Lists all running functions within the current Murex session
    98  * [`open`](../commands/open.md):
    99    Open a file with a preferred handler
   100  * [`private`](../commands/private.md):
   101    Define a private function block
   102  * [`source`](../commands/source.md):
   103    Import Murex code from another file of code block
   104  
   105  <hr/>
   106  
   107  This document was generated from [builtins/core/management/fexec_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/management/fexec_doc.yaml).