Description
Inspect a supplied Bash ANSI-C quoting Unicode escape without executing shell text.
Shell token meaning depends on quote context, escape syntax, parameter expansion, and the particular shell. A literal split or escape decoder can inspect text without evaluating it. Recognizing a token does not execute a command or reproduce every rule of a complete shell parser.
Inspect a supplied Bash ANSI-C quoting Unicode escape without executing shell text.
When to use this tool
Use Shell Dollar Quote Unicode Width when you need to inspect the supported literal shell-related token or escape without evaluating it.
How to use the tool and how it works
- Enter escape. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read hexWidth, codePoint, scalar. Inspect scalar before interpreting the associated values.
Accept a backslash-u token with 1-4 hex digits or backslash-U with 1-8 hex digits. Return hexWidth as the maximum permitted width, codePoint as the decoded integer, and scalar when within U+0000 through U+10FFFF outside surrogates.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| escape | Escape | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| hexWidth | Maximum accepted hex width, four or eight; not actual digit count. | Required. Safe integer. |
| codePoint | Numeric Unicode value; inspect the stated scalar-validity policy. | Required. Safe integer. |
| scalar | Whether decoded integer is a Unicode scalar; false values are still returned. | Required. Boolean. |
{
"input": {
"escape": "\\u0041"
},
"output": {
"hexWidth": 4,
"codePoint": 65,
"scalar": true
}
} Limitations and assumptions
- Non-scalar values return scalar=false rather than being rejected after the grammar check. No character is emitted, and support for this escape syntax depends on the shell and quoting context.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use a shell-aware lexer or parser for quote context, concatenated words, nested expansions, and complete command syntax. Preserve untrusted text as data when its role is inspection.
References
Similar or alternative tools
- Shell Ansi C Hex Escape
Decode a restricted one- or two-digit ANSI-C-style hexadecimal byte escape.
- Properties Unicode Escape Four Digits
Decode one four-digit nonsurrogate properties-style Unicode escape.