github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/core/management/functions_doc.yaml (about) 1 - DocumentID: exitnum 2 Title: >+ 3 `exitnum` 4 CategoryID: commands 5 Summary: >- 6 Output the exit number of the previous process 7 Description: |- 8 Output the exit number of the previous process. 9 Usage: |- 10 ``` 11 exitnum -> <stdout> 12 ``` 13 Examples: |- 14 ``` 15 » exitnum 16 0 17 ``` 18 Flags: 19 Detail: |- 20 Synonyms: 21 Related: 22 - runtime 23 - test 24 25 26 - DocumentID: os 27 Title: >+ 28 `os` 29 CategoryID: commands 30 Summary: >- 31 Output the auto-detected OS name 32 Description: |- 33 Output the auto-detected OS name. 34 Usage: |- 35 ``` 36 os -> <stdout> 37 38 os string -> <stdout> 39 ``` 40 Examples: |- 41 ``` 42 » os 43 linux 44 ``` 45 46 Or if you want to check if the host is one of a number of platforms: 47 48 ``` 49 # When run on Linux or FreeBSD 50 » os linux freebsd 51 true 52 53 # When run on another platform, eg Windows or Darwin (OSX) 54 # (exit number would also be `1`) 55 » os linux freebsd 56 false 57 ``` 58 59 `posix` is also supported: 60 61 ``` 62 # When run on Linux, FreeBSD or Darwin (for example) 63 » os posix 64 true 65 66 # When run on Windows or Plan 9 67 # (exit number would also be `1`) 68 » os posix 69 false 70 ``` 71 72 Please note that although Plan 9 shares similarities with POSIX, it is not 73 POSIX-compliant. For that reason, `os` returns false with the `posix` 74 parameter when run on Plan 9. If you want to include Plan 9 in the check 75 then please write it as `os posix plan9`. 76 Flags: 77 Detail: |- 78 Synonyms: 79 Related: 80 - cpuarch 81 - cpucount 82 83 84 - DocumentID: cpuarch 85 Title: >+ 86 `cpuarch` 87 CategoryID: commands 88 Summary: >- 89 Output the hosts CPU architecture 90 Description: |- 91 Output the hosts CPU architecture. 92 Usage: |- 93 ``` 94 cpuarch -> <stdout> 95 ``` 96 Examples: |- 97 ``` 98 » cpuarch 99 amd64 100 ``` 101 Flags: 102 Detail: |- 103 Synonyms: 104 Related: 105 - os 106 - cpucount 107 108 109 - DocumentID: cpucount 110 Title: >+ 111 `cpucount` 112 CategoryID: commands 113 Summary: >- 114 Output the number of CPU cores available on your host 115 Description: |- 116 Output the number of CPU cores available on your host. 117 Usage: |- 118 ``` 119 cpucount -> <stdout> 120 ``` 121 Examples: |- 122 ``` 123 » cpucount 124 4 125 ``` 126 Flags: 127 Detail: |- 128 Synonyms: 129 Related: 130 - os 131 - cpuarch 132 133 134 - DocumentID: murex-update-exe-list 135 Title: >+ 136 `murex-update-exe-list` 137 CategoryID: commands 138 Summary: >- 139 Forces Murex to rescan $PATH looking for executables 140 Description: |- 141 On application launch, Murex scans and caches all the executables found in 142 $PATH on your host. Murex then does regular scans there after. However if 143 you want to force a new scan (for example you've just installed a new 144 program and you want it to appear in tab completion) then you can run `murex-update-exe-list`. 145 Usage: |- 146 ``` 147 murex-update-exe-list 148 ``` 149 Examples: |- 150 ``` 151 » murex-update-exe-list 152 ``` 153 Flags: 154 Detail: |- 155 Murex will automatically update the exe list each time tab completion is 156 invoked for command name completion via the REPL shell. 157 Synonyms: 158 Related: 159 - os 160 - cpuarch 161 - cpucount 162 163 164 - DocumentID: man-summary 165 Title: >+ 166 `man-summary` 167 CategoryID: commands 168 Summary: >- 169 Outputs a man page summary of a command 170 Description: |- 171 `man-summary` reads the man pages for a given command and outputs it's 172 summary (if one exists). 173 Usage: |- 174 ``` 175 man-summary command -> <stdout> 176 ``` 177 Examples: |- 178 ``` 179 » man-summary man 180 man - an interface to the on-line reference manuals 181 ``` 182 Flags: 183 Detail: |- 184 Synonyms: 185 Related: 186 - summary 187 - config 188 - murex-docs 189 - man-get-flags 190 191 192 - DocumentID: cd 193 Title: >+ 194 `cd` 195 CategoryID: commands 196 Summary: >- 197 Change (working) directory 198 Description: |- 199 Changes current working directory. 200 Usage: |- 201 ``` 202 cd [path] 203 ``` 204 Examples: |- 205 **Home directory:** 206 207 ``` 208 » cd ~ 209 ``` 210 211 Running `cd` without a parameter will also change to the current user's home 212 directory: 213 214 ``` 215 » cd 216 ``` 217 218 **Navigating to the previous directory:** 219 220 ``` 221 » cd - 222 ``` 223 224 **Absolute path:** 225 226 ``` 227 » cd /etc/ 228 ``` 229 230 **Relative path:** 231 232 ``` 233 » cd Documents 234 » cd ./Documents 235 ``` 236 Flags: 237 Detail: |- 238 `cd` updates an environmental variable, `$PWDHIST` with an array of paths. 239 You can then use that to change to a previous directory. 240 241 **View the working directory history:** 242 243 ``` 244 » $PWDHIST 245 ``` 246 247 **Change to a previous directory:** 248 249 ``` 250 » cd $PWDHIST[-1] 251 ``` 252 253 > `cd -` is syntactic sugar for `$PWDHIST[-1]` 254 255 ### auto-cd 256 257 Some people prefer to omit `cd` and just write the path, with their shell 258 automatically changing to that directory if the "command" is just a directory. 259 In Murex you can enable this behaviour by turning on "auto-cd": 260 261 ``` 262 config set shell auto-cd true 263 ``` 264 Synonyms: 265 Related: 266 - reserved-vars 267 - source 268 269 270 - DocumentID: bexists 271 Title: >+ 272 `bexists` 273 CategoryID: commands 274 Summary: >- 275 Check which builtins exist 276 Description: |- 277 `bexists` takes an array of parameters and returns which commands have been 278 compiled into Murex. The 'b' in `bexists` stands for 'builtins' 279 Usage: |- 280 ``` 281 bexists command... -> <stdout> 282 ``` 283 Examples: |- 284 ``` 285 » bexists: qr gzip runtime config 286 { 287 "Installed": [ 288 "runtime", 289 "config" 290 ], 291 "Missing": [ 292 "qr", 293 "gzip" 294 ] 295 } 296 ``` 297 Flags: 298 Detail: |- 299 This builtin dates back to the start of Murex when all of the builtins were 300 considered optional. This was intended to be a way for scripts to determine 301 which builtins were compiled. Since then `runtime` has absorbed and centralized 302 a number of similar commands which have since been deprecated. The same fate 303 might also happen to `bexists` however it is in use by a few modules and for 304 that reason alone it has been spared from the axe. 305 Synonyms: 306 Related: 307 - runtime 308 - fexec 309 - modules 310 311