OILS / doc / ref / feature-index.md View on Github | oilshell.org

154 lines, 96 significant
1---
2title: YSH and OSH Topics by Feature
3all_docs_url: ..
4default_highlighter: oils-sh
5preserve_anchor_case: yes
6---
7
8YSH and OSH Topics by Feature
9====
10
11<span class="in-progress">(in progress)</span>
12
13This page links to topics in the [Oils Reference](index.html). It's organized
14differently than the [YSH Table of Contents](toc-ysh.html) or [OSH Table of
15Contents](toc-osh.html).
16
17<div id="toc">
18</div>
19
20## Where YSH Improves on OSH
21
22### Errors
23
24YSH:
25
26- [`try`](chap-builtin-cmd.html#try)
27- [`_error`](chap-special-var.html#_error)
28- multiple processes
29 - [`_pipeline_status`](chap-special-var.html#_pipeline_status)
30 - [`_process_sub_status`](chap-special-var.html#_process_sub_status)
31
32OSH:
33
34- [`$?`](chap-special-var.html#POSIX-special) - not idiomatic in YSH
35
36### Environment Variables
37
38YSH:
39
40- [ENV](chap-special-var.html#ENV)
41- `[simple-command][]` - for `NAME=val` env
42 bindings
43 - TODO: should we have a `envFromDict()` function that goes with `env -i`?
44
45OSH:
46
47- [`export`](chap-osh-assign.html#export)
48
49[simple-command]: chap-cmd-lang.html#simple-command
50
51### I/O
52
53YSH:
54
55- [`write`](chap-builtin-cmd.html#write)
56 - [`echo`](chap-builtin-cmd.html#ysh-echo) is a shortcut for `write`
57- [`read`](chap-builtin-cmd.html#ysh-read) - `read --all`, etc.
58- [`redir`](chap-builtin-cmd.html#redir)
59- The [`io`](chap-type-method.html#io) object
60
61OSH:
62
63- [`printf`](chap-builtin-cmd.html#printf)
64
65### Procs
66
67YSH:
68
69- [`proc`](chap-ysh-cmd.html#proc)
70- Invokable objects: [`__invoke__`][__invoke__], [`Obj`][Obj]
71- [`simple-command`][simple-command] is how you invoke procs
72
73OSH:
74
75- [`sh-func`](chap-cmd-lang.html#sh-func)
76
77### Modules
78
79- [`use`](chap-builtin-cmd.html#use)
80- [`is-main`](chap-builtin-cmd.html#is-main)
81- provide (TODO)
82- [`__provide__`](chap-special-var.html#__provide__)
83- An imported module is an [`Obj`][Obj] with an [`__invoke__`][__invoke__]
84 method
85
86[Obj]: chap-type-method.html#Obj
87[__invoke__]: chap-type-method.html#__invoke__
88
89OSH:
90
91- [`source`](chap-builtin-cmd.html#source)
92- [`source-guard`](chap-builtin-cmd.html#source-guard)
93
94### Interactive Shell
95
96- [`renderPrompt()`](chap-plugin.html#renderPrompt)
97
98OSH:
99
100- [`complete`][complete]
101- Oils enhancements: [`compexport`][compexport], [`compadjust`][compadjust]
102
103[complete]: chap-builtin-cmd.html#complete
104[compadjust]: chap-builtin-cmd.html#compadjust
105[compexport]: chap-builtin-cmd.html#compexport
106
107### Tracing
108
109- `set -x` aka `set -o xtrace`
110- [PS4][]
111- `SHX_*`
112
113[PS4]: chap-plugin.html#PS4
114
115### Unicode
116
117- TODO: which functions respect Unicode?
118
119Also see [the Unicode doc](../unicode.html).
120
121
122
123
124## YSH Only
125
126### Objects
127
128- [`Obj`][Obj]
129- `propView()` and `prototype()` - may be renamed `first() rest()`
130- operator `.` [ysh-attr](chap-expr-lang.html#ysh-attr)
131- operator `->` [thin-arrow](chap-expr-lang.html#thin-arrow)
132
133### Closures
134
135- [block-arg](chap-cmd-lang.html#block-arg)
136- Maybe: proc, func
137
138### Funcs
139
140- [`func`](chap-ysh-cmd.html#func)
141- Callable objects: [`__call__`][__call__] and [`Obj`][Obj] (TODO)
142- [`ysh-func-call`](chap-expr-lang.html#ysh-func-call)
143
144[__call__]: chap-type-method.html#__call__
145
146### Reflection
147
148- The [`io`][io] object has `eval()` methods, etc.
149- The [`vm`][vm] object for inspecting interpreter structures
150
151[io]: chap-type-method.html#io
152[vm]: chap-type-method.html#vm
153
154