1 | ---
|
2 | title: Mini Languages (Oils Reference)
|
3 | all_docs_url: ..
|
4 | body_css_class: width40
|
5 | default_highlighter: oils-sh
|
6 | preserve_anchor_case: yes
|
7 | ---
|
8 |
|
9 | <div class="doc-ref-header">
|
10 |
|
11 | [Oils Reference](index.html) —
|
12 | Chapter **Mini Languages**
|
13 |
|
14 | </div>
|
15 |
|
16 | This chapter describes "mini-languages" like glob patterns and brace expansion.
|
17 |
|
18 | In 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 |
|
56 | TODO: glob syntax
|
57 |
|
58 | ### extglob
|
59 |
|
60 | TODO: extended glob syntax
|
61 |
|
62 | ### regex
|
63 |
|
64 | Part of [dbracket](chap-cmd-lang.html#dbracket)
|
65 |
|
66 | ## Other Sublang
|
67 |
|
68 | ### braces
|
69 |
|
70 | ### histsub
|
71 |
|
72 | History substitution uses `!`.
|
73 |
|
74 | ### char-escapes
|
75 |
|
76 | These backslash escape sequences are used in [echo
|
77 | -e](chap-builtin-cmd.html#echo), [printf](chap-builtin-cmd.html#printf), and in
|
78 | C-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 |
|
94 | Also:
|
95 |
|
96 | \" Double quote.
|
97 |
|
98 | Inconsistent octal escapes:
|
99 |
|
100 | \0NNN echo -e '\0123'
|
101 | \NNN printf '\123'
|
102 | echo $'\123'
|
103 |
|
104 | TODO: Verify other differences between `echo -e`, `printf`, and `$''`. See
|
105 | `frontend/lexer_def.py`.
|
106 |
|