bytes ends-with
For bytes.
Check if binary data ends with a pattern.
Command Type
built-in
Signature
> bytes ends-with {flags} (pattern) ...rest
Parameters
pattern: The pattern to match....rest: For a data structure input, check if bytes at the given cell paths end with the pattern.
Input/output types:
| input | output |
|---|---|
| binary | bool |
| table | table |
| record | record |
Examples
Checks if binary ends with 0x[AA].
> 0x[1F FF AA AA] | bytes ends-with 0x[AA]
true
Checks if binary ends with 0x[FF AA AA].
> 0x[1F FF AA AA] | bytes ends-with 0x[FF AA AA]
true
Checks if binary ends with 0x[11].
> 0x[1F FF AA AA] | bytes ends-with 0x[11]
false
Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.