OILS / doc / ref / chap-mini-lang.md View on Github | oilshell.org

101 lines, 63 significant
1---
2in_progress: yes
3body_css_class: width40 help-body
4default_highlighter: oils-sh
5preserve_anchor_case: yes
6---
7
8Mini Languages
9===
10
11This chapter in the [Oils Reference](index.html) describes "mini-languages".
12
13In contrast, the main sub languages of YSH are [command](chap-cmd-lang.html),
14[word](chap-word-lang.html), and [expression](chap-expr-lang.html).
15
16<div id="toc">
17</div>
18<h2 id="sublang">Other Shell Sublanguages</h2>
19
20## Arithmetic
21
22### arith-context
23
24### sh-numbers
25
26### sh-arith
27
28### sh-logical
29
30### sh-bitwise
31
32## Boolean
33
34### dbracket
35
36Compatible with bash.
37
38### bool-expr
39
40### bool-infix
41
42### bool-path
43
44### bool-str
45
46### bool-other
47
48## Patterns
49
50### glob-pat
51
52TODO: glob syntax
53
54### extglob
55
56TODO: extended glob syntax
57
58### regex
59
60Part of [dbracket]($osh-help)
61
62## Other Sublang
63
64### braces
65
66### histsub
67
68History substitution uses `!`.
69
70### char-escapes
71
72These backslash escape sequences are used in `echo -e`, [printf]($osh-help),
73and in C-style strings like `$'foo\n'`:
74
75 \\ backslash
76 \a alert (BEL)
77 \b backspace
78 \c stop processing remaining input
79 \e the escape character \x1b
80 \f form feed
81 \n newline
82 \r carriage return
83 \t tab
84 \v vertical tab
85 \xHH the byte with value HH, in hexadecimal
86 \uHHHH the unicode char with value HHHH, in hexadecimal
87 \UHHHHHHHH the unicode char with value HHHHHHHH, in hexadecimal
88
89Also:
90
91 \" Double quote.
92
93Inconsistent octal escapes:
94
95 \0NNN echo -e '\0123'
96 \NNN printf '\123'
97 echo $'\123'
98
99TODO: Verify other differences between `echo -e`, `printf`, and `$''`. See
100`frontend/lexer_def.py`.
101