Description
Decode a restricted one- or two-digit ANSI-C-style hexadecimal byte escape.
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.
Decode a restricted one- or two-digit ANSI-C-style hexadecimal byte escape.
When to use this tool
Use Shell Ansi C Hex Escape 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 token. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read octet. Use the output convention below.
Accept exactly backslash-x followed by one or two ASCII hex digits and return octet as their base-16 integer value.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| token | Complete literal token in the grammar stated above. | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| octet | Octet | Required. Safe integer. |
{
"input": {
"token": "\\x41"
},
"output": {
"octet": 65
}
} Limitations and assumptions
- This returns a byte value, not a decoded Unicode character or executed shell string. Exact ANSI-C quoting behavior and whether the escape is recognized depend on the surrounding shell syntax.
- 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
- Parsing: Shell Back Slash Newline Token
Remove literal backslash-LF continuations from a caller-established unquoted shell fragment; excludes shell parsing, quoted contexts and CRLF normalization.
- Shell Dollar Quote Unicode Width
Inspect a supplied Bash ANSI-C quoting Unicode escape without executing shell text.