Skip to content

Main content

Shell Dollar Quote Unicode Width Tool

Inspect a supplied Bash ANSI-C quoting Unicode escape without executing shell text.

Loading tool…

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

  1. Enter escape. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
escapeEscapeRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
hexWidthMaximum accepted hex width, four or eight; not actual digit count.Required. Safe integer.
codePointNumeric Unicode value; inspect the stated scalar-validity policy.Required. Safe integer.
scalarWhether decoded integer is a Unicode scalar; false values are still returned.Required. Boolean.
json
{
  "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

  1. Calculation and input contract: parse/shell-dollar-quote-unicode-width — tool.io

Similar or alternative tools