Warning: Work in progress! Leave feedback on Zulip or Github if you'd like this doc to be updated.

Mini Languages

This chapter in the Oils Reference describes "mini-languages".

In contrast, the main sub languages of YSH are command, word, and expression.

Table of Contents
Other Shell Sublanguages
Arithmetic
arith-context
sh-numbers
sh-arith
sh-logical
sh-bitwise
Boolean
dbracket
bool-expr
bool-infix
bool-path
bool-str
bool-other
Patterns
glob
extglob
regex
Other Sublang
braces
histsub
char-escapes

Other Shell Sublanguages

Arithmetic

arith-context

sh-numbers

sh-arith

sh-logical

sh-bitwise

Boolean

dbracket

Compatible with bash.

bool-expr

bool-infix

bool-path

bool-str

bool-other

Patterns

glob

extglob

regex

Part of dbracket

Other Sublang

braces

histsub

History substitution uses !.

char-escapes

These backslash escape sequences are used in echo -e, printf, and in C-style strings like $'foo\n':

\\         backslash
\a         alert (BEL)
\b         backspace
\c         stop processing remaining input
\e         the escape character \x1b
\f         form feed
\n         newline
\r         carriage return
\t         tab
\v         vertical tab
\xHH       the byte with value HH, in hexadecimal
\uHHHH     the unicode char with value HHHH, in hexadecimal
\UHHHHHHHH the unicode char with value HHHHHHHH, in hexadecimal

Also:

\"         Double quote.

Inconsistent octal escapes:

\0NNN      echo -e '\0123'
\NNN       printf '\123'
           echo $'\123'

TODO: Verify other differences between echo -e, printf, and $''. See frontend/lexer_def.py.


Generated on Wed, 06 Dec 2023 01:04:01 -0500