Skip to content

1x should output empty line if input doesn't contain newline #306

@cakebaker

Description

@cakebaker

GNU sed outputs an empty line with 1x if the input doesn't contain a newline. uutils sed, on the other hand, doesn't:

$ printf "abc" | sed 1x

$ 
$ printf "abc" | cargo run -q sed 1x
$

The exception is an empty string as input: in such a case there is no output.

$ printf "" | sed 1x
$ 
$ printf "" | cargo run -q sed 1x
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions