-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jo will drop the trailing newline at the end of file #199
Comments
It made sense to me/us to have that stripped. Why would you not want it stripped? |
We should probably amend the description in the man page. |
But I want to make a json with the exact content of a file as it-is. Could I archieve this with |
The only solution which occurs to me right now is to transport with base64 and then decode on the receiving end: $ echo hello > test.txt
$ jo 'test=%test.txt'
{"test":"aGVsbG8K"}
$ echo aGVsbG8K | base64 -d
hello
$ echo aGVsbG8K | base64 -d | od -cb
0000000 h e l l o \n
150 145 154 154 157 012
0000006 |
Really hope |
It would invalidate any checksum or signature on the content of that file. |
Since trimming the output has been the default operation for years with no complaints until now, it might not be desirable to unilaterally switch to verbatim inclusion mode by default. I guess we could add a |
I'm not hugely in favor of a switch to toggle that behaviour. Would a separate character make sense? BTW, if we do implement this, the underlying JSON routines will not handle binary zero |
The manual says:
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
The text was updated successfully, but these errors were encountered: