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

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