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

     1  # `type`
     2  
     3  > Command type (function, builtin, alias, etc)
     4  
     5  ## Description
     6  
     7  `type` returns information about the type of the command. This is a POSIX
     8  requirement and not to be confused with Murex data types. 
     9  
    10  ## Usage
    11  
    12  ```
    13  type command -> <stdout>
    14  ```
    15  
    16  ## Examples
    17  
    18  **TTY output:**
    19  
    20  ```
    21  » type murex-docs
    22  `murex-docs` is a shell function:
    23  
    24      # Wrapper around builtin to pipe to less
    25  
    26      config: set proc strict-arrays false
    27      fexec: builtin murex-docs @PARAMS | less
    28  ```
    29  
    30  **Piped output:**
    31  
    32  ```
    33  » type murex-docs -> cat
    34  function
    35  ```
    36  
    37  ## Detail
    38  
    39  There are a few different types of commands:
    40  
    41  ### alias
    42  
    43  This will be represented in `which` and `type` by the term **alias** and, when
    44  STDOUT is a TTY, `which` will follow the alias to print what command the alias
    45  points to.
    46  
    47  ### function
    48  
    49  This is a Murex function (defined via `function`) and will be represented in
    50  `which` and `type` by the term **function**.
    51  
    52  ### private
    53  
    54  This is a private function (defined via `private`) and will be represented in
    55  `which` and `type` by the term **private**.
    56  
    57  ### builtin
    58  
    59  This is a shell builtin, like `out` and `exit`. It will be represented in
    60  `which` and `type` by the term **builtin**.
    61  
    62  ### external executable
    63  
    64  This is any other external command, such as `systemctl` and `python`. This
    65  will be represented in `which` by the path to the executable. When STDOUT is a
    66  TTY, `which` will also print the destination path of any symlinks too.
    67  
    68  In `type`, it is represented by the term **executable**.
    69  
    70  ## See Also
    71  
    72  * [`alias`](../commands/alias.md):
    73    Create an alias for a command
    74  * [`exec`](../commands/exec.md):
    75    Runs an executable
    76  * [`exit`](../commands/exit.md):
    77    Exit murex
    78  * [`fexec` ](../commands/fexec.md):
    79    Execute a command or function, bypassing the usual order of precedence.
    80  * [`function`](../commands/function.md):
    81    Define a function block
    82  * [`out`](../commands/out.md):
    83    Print a string to the STDOUT with a trailing new line character
    84  * [`which`](../commands/which.md):
    85    Locate command origin
    86  
    87  <hr/>
    88  
    89  This document was generated from [builtins/core/management/type_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/management/type_doc.yaml).