Skip to content

Add flag to read to split on NUL #1694

@lilyball

Description

@lilyball

read should have a flag that makes it split on NUL instead of on $IFS. There are a number of commands that use NUL as a record separator, and it would be great if fish could loop over those. Since fish does not support using NUL on the command-line, there is no way to set $IFS to contain NUL, and therefore no way to split on NUL at the moment. Ideally, fish would learn to accept NUL everywhere, but that seems extremely unlikely to happen given the frequency with which fish has to use wchar_t* instead of wcstring.

Similarly, it would be great if command substitution could learn to optionally split on NUL instead of newline, but I can't think of any good syntax for that. However, if read can split on NUL, then the problem can be worked around by piping the output into read instead.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions