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

     1  # `os`
     2  
     3  > Output the auto-detected OS name
     4  
     5  ## Description
     6  
     7  Output the auto-detected OS name.
     8  
     9  ## Usage
    10  
    11  ```
    12  os -> <stdout>
    13  
    14  os string -> <stdout>
    15  ``` 
    16  
    17  ## Examples
    18  
    19  ```
    20  » os
    21  linux
    22  ```
    23  
    24  Or if you want to check if the host is one of a number of platforms:
    25  
    26  ```
    27  # When run on Linux or FreeBSD
    28  » os linux freebsd
    29  true
    30  
    31  # When run on another platform, eg Windows or Darwin (OSX)
    32  # (exit number would also be `1`)
    33  » os linux freebsd
    34  false
    35  ```
    36  
    37  `posix` is also supported:
    38  
    39  ```
    40  # When run on Linux, FreeBSD or Darwin (for example)
    41  » os posix
    42  true
    43  
    44  # When run on Windows or Plan 9
    45  # (exit number would also be `1`)
    46  » os posix
    47  false
    48  ```
    49  
    50  Please note that although Plan 9 shares similarities with POSIX, it is not
    51  POSIX-compliant. For that reason, `os` returns false with the `posix`
    52  parameter when run on Plan 9. If you want to include Plan 9 in the check
    53  then please write it as `os posix plan9`.
    54  
    55  ## See Also
    56  
    57  * [`cpuarch`](../commands/cpuarch.md):
    58    Output the hosts CPU architecture
    59  * [`cpucount`](../commands/cpucount.md):
    60    Output the number of CPU cores available on your host
    61  
    62  <hr/>
    63  
    64  This document was generated from [builtins/core/management/functions_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/management/functions_doc.yaml).