I think that this should work, though I haven't tested it.
Thanks. It works! I removed the
-H part to get json format output, where the decoded raw tx is in the
"result" field.
I also changed
-data-binary to
-data so that it doesn't matter if the hex tx has a \n in it.