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

156 lines, 98 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 bindings
42 - TODO: should we have a `envFromDict()` function that goes with `env -i`?
43- [Options](chap-option.html):
44 - `shopt --unset no_exported`
45 - `shopt --set env_obj`
46
47OSH:
48
49- [`export`](chap-osh-assign.html#export)
50
51[simple-command]: chap-cmd-lang.html#simple-command
52
53### I/O
54
55YSH:
56
57- [`write`](chap-builtin-cmd.html#write)
58 - [`echo`](chap-builtin-cmd.html#ysh-echo) is a shortcut for `write`
59- [`read`](chap-builtin-cmd.html#ysh-read) - `read --all`, etc.
60- [`redir`](chap-builtin-cmd.html#redir)
61- The [`io`](chap-type-method.html#io) object
62
63OSH:
64
65- [`printf`](chap-builtin-cmd.html#printf)
66
67### Procs
68
69YSH:
70
71- [`proc`](chap-ysh-cmd.html#proc)
72- Invokable objects: [`__invoke__`][__invoke__], [`Obj`][Obj]
73- [`simple-command`][simple-command] is how you invoke procs
74
75OSH:
76
77- [`sh-func`](chap-cmd-lang.html#sh-func)
78
79### Modules
80
81- [`use`](chap-builtin-cmd.html#use)
82- [`is-main`](chap-builtin-cmd.html#is-main)
83- provide (TODO)
84- [`__provide__`](chap-special-var.html#__provide__)
85- An imported module is an [`Obj`][Obj] with an [`__invoke__`][__invoke__]
86 method
87
88[Obj]: chap-type-method.html#Obj
89[__invoke__]: chap-type-method.html#__invoke__
90
91OSH:
92
93- [`source`](chap-builtin-cmd.html#source)
94- [`source-guard`](chap-builtin-cmd.html#source-guard)
95
96### Interactive Shell
97
98- [`renderPrompt()`](chap-plugin.html#renderPrompt)
99
100OSH:
101
102- [`complete`][complete]
103- Oils enhancements: [`compexport`][compexport], [`compadjust`][compadjust]
104
105[complete]: chap-builtin-cmd.html#complete
106[compadjust]: chap-builtin-cmd.html#compadjust
107[compexport]: chap-builtin-cmd.html#compexport
108
109### Tracing
110
111- `set -x` aka `set -o xtrace`
112- [PS4][]
113- `SHX_*`
114
115[PS4]: chap-plugin.html#PS4
116
117### Unicode
118
119- TODO: which functions respect Unicode?
120
121Also see [the Unicode doc](../unicode.html).
122
123
124
125
126## YSH Only
127
128### Objects
129
130- [`Obj`][Obj]
131- `propView()` and `prototype()` - may be renamed `first() rest()`
132- operator `.` [ysh-attr](chap-expr-lang.html#ysh-attr)
133- operator `->` [thin-arrow](chap-expr-lang.html#thin-arrow)
134
135### Closures
136
137- [block-arg](chap-cmd-lang.html#block-arg)
138- Maybe: proc, func
139
140### Funcs
141
142- [`func`](chap-ysh-cmd.html#func)
143- Callable objects: [`__call__`][__call__] and [`Obj`][Obj] (TODO)
144- [`ysh-func-call`](chap-expr-lang.html#ysh-func-call)
145
146[__call__]: chap-type-method.html#__call__
147
148### Reflection
149
150- The [`io`][io] object has `eval()` methods, etc.
151- The [`vm`][vm] object for inspecting interpreter structures
152
153[io]: chap-type-method.html#io
154[vm]: chap-type-method.html#vm
155
156