Hacker News new | ask | show | jobs
by jessaustin 3012 days ago
It looks like your quote characters might be messed up there? Anyway, to parse json on the command line one should just use jq.
1 comments

Single quotes were modified by HN engine, right. It is not a command line (thinking of sed?), it is the middle of a source code in my editor. I have a json-parsed message and t is a target object.

  a b foo c

  t.a = !!message.a;
  t.b = String(message.b);
  t.foo = message.foo;
  t.c = tonum(message.c);