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

     1  # `get-type`
     2  
     3  > Returns the data-type of a variable or pipe
     4  
     5  ## Description
     6  
     7  `get-type` returns the Murex data-type of a variable or pipe without
     8  reading the data from it.
     9  
    10  ## Usage
    11  
    12  ```
    13  get-type \$variable -> <stdout>
    14  
    15  get-type stdin -> <stdout>
    16  
    17  get-type pipe -> <stdout>
    18  ```
    19  
    20  ## Examples
    21  
    22  Get the data-type of a variable
    23  
    24  ```
    25  » set json example={[1,2,3]}
    26  » get-type \$example
    27  json
    28  ```
    29  
    30  > Please note that you will need to escape the dollar sign. If you don't
    31  > the value of the variable will be passed to `get-type` rather than the
    32  > name.
    33  
    34  Get the data-type of a functions STDIN
    35  
    36  ```
    37  » function example { get-type stdin }
    38  » tout json {[1,2,3]} -> example
    39  json
    40  ```
    41  
    42  Get the data-type of a Murex named pipe
    43  
    44  ```
    45  » pipe example
    46  » tout <example> json {[1,2,3]}
    47  » get-type example
    48  » !pipe example
    49  json
    50  ```
    51  
    52  ## See Also
    53  
    54  * [Reserved Variables](../user-guide/reserved-vars.md):
    55    Special variables reserved by Murex
    56  * [Variable and Config Scoping](../user-guide/scoping.md):
    57    How scoping works within Murex
    58  * [`debug`](../commands/debug.md):
    59    Debugging information
    60  * [`function`](../commands/function.md):
    61    Define a function block
    62  * [`pipe`](../commands/pipe.md):
    63    Manage Murex named pipes
    64  * [`runtime`](../commands/runtime.md):
    65    Returns runtime information on the internal state of Murex
    66  * [`set`](../commands/set.md):
    67    Define a local variable and set it's value
    68  * [`tout`](../commands/tout.md):
    69    Print a string to the STDOUT and set it's data-type
    70  
    71  <hr/>
    72  
    73  This document was generated from [builtins/core/typemgmt/gettype_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/typemgmt/gettype_doc.yaml).