1 |
|
2 | Builtin Commands <a class="group-link" href="chap-builtin-cmd.html">builtin-cmd</a>
|
3 |
|
4 |
|
5 | [Memory] cmd/append Add elements to end of array
|
6 | pp asdl cell X gc-stats line proc
|
7 | [Handle Errors] error error 'failed' (status=2)
|
8 | try Run with errexit, set _error
|
9 | failed Test if _error.code !== 0
|
10 | boolstatus Enforce 0 or 1 exit status
|
11 | [Shell State] ysh-cd ysh-shopt compatible, and takes a block
|
12 | shvar Temporary modify global settings
|
13 | ctx Share and update a temporary "context"
|
14 | push-registers Save registers like $?, PIPESTATUS
|
15 | [Modules] runproc Run a proc; use as main entry point
|
16 | module guard against duplicate 'source'
|
17 | is-main false when sourcing a file
|
18 | use change first word lookup
|
19 | [I/O] ysh-read flags --all, -0
|
20 | ysh-echo no -e -n with simple_echo
|
21 | write Like echo, with --, --sep, --end
|
22 | fork forkwait Replace & and (), and takes a block
|
23 | fopen Open multiple streams, takes a block
|
24 | X dbg Only thing that can be used in funcs
|
25 | X log X die Common functions (polyfill)
|
26 | [Hay Config] hay haynode For DSLs and config files
|
27 | [Completion] compadjust compexport
|
28 | [Data Formats] json read write
|
29 | json8 read write
|
30 | X [Lines] slurp-by combine adjacent lines into cells
|
31 | X [Awk] each-line --j8 --max-jobs (Str, Template, Block) - xargs
|
32 | each-row --max-jobs (Str, Template, Block) - xargs
|
33 | split-by (str=\n, ifs=':', pattern=/s+/)
|
34 | if-split-by
|
35 | chop alias for split-by (pattern=/s+/)
|
36 | must-match (/ <capture d+> </capture w+> /)
|
37 | if-match
|
38 | X [Table Create] table --by-row --by-col (&place); construct/parse a table
|
39 | table/cols cols name age - cols name:Str age:Int
|
40 | types type Str Int
|
41 | attr attr units - secs
|
42 | row emit row
|
43 | table cat concatenate TSV8
|
44 | table align to ssv8
|
45 | table tabify to tsv8
|
46 | table header (cols = :|name age|, types = :|Str Int|, units = :|- secs|)
|
47 | table slice e.g. slice (1, -1) slice (5, 7)
|
48 | table to-tsv lose type info, and error on \t in cells
|
49 | X [Table Ops] where subset of rows; dplyr filter()
|
50 | pick subset of columns ('select' taken by shell)
|
51 | mutate transmute [average = count / sum] - drop the ones that are used?
|
52 | rename (bytes='bytes', path='filename')
|
53 | group-by add a column with a group ID [ext]
|
54 | sort-by sort by columns; dplyr arrange() [ext]
|
55 | summary count, sum, histogram, any, all, reduce(), etc. [ext]
|
56 | [Args Parser] parser Parse command line arguments
|
57 | flag
|
58 | arg
|
59 | rest
|
60 | parseArgs()
|
61 | X [Testing] describe Test harness
|
62 | assert takes an expression
|