Skip to content

jo will drop the trailing newline at the end of file #199

@tw4452852

Description

@tw4452852
> echo foo > test.txt
> jo 'test=@test.txt'
{"test":"foo"}

The manual says:

@file substitute the contents of file as-is

Why the trailing newline is stripped when processing? I expect jo should leave the content string the same as the file content.
BTW, the code is here:

jo/jo.c

Line 350 in b3e67e1

if (*bp == '\n') *bp-- = 0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions