Closed h4l closed 2 days ago
I don't see why you would expect that to happen; I wouldn't.
Maybe I'm misunderstanding the intention of the -s
flag, I assumed it would force the value to be treated as a string. Is there a way to produce the string "null"
with jo?
Yes, escape the first letter with a backslash:
$ jo -- -s foo=\\null
{"foo":"null"}
Note that the null
-to-""
coercion is explicitly documented in the man page.
OK, thank you.
The
-s
string coercion flag results in an empty string when the value isnull
:I would expect the result to be
{"foo":"null"}
.