W3cubDocs

/Nushell

bytes collect for bytes

Concatenate multiple binary into a single binary, with an optional separator between each.

Signature

> bytes collect {flags} (separator)

Parameters

  • separator: optional separator to use when creating binary

Input/output types:

input output
list<binary> binary

Examples

Create a byte array from input

> [0x[11] 0x[1315]] |bytes collect
Length:3 (0x3) bytes|printablewhitespaceascii_othernon_ascii
00000000:111315•••

Create a byte array from input with a separator

> [0x[11] 0x[33] 0x[44]] |bytes collect0x[01]
Length:5 (0x5) bytes|printablewhitespaceascii_othernon_ascii
00000000:1101330144••3•D

Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/bytes_collect.html