Thanks arulbero & HCP.
So I removed
all quote marks around the inputs and around the outputs from the .json text files, and removed
all spaces
except for the space between the inputs and outputs. I also removed all array brackets (square brackets like these [ ] ) from around the outputs.
tx.json:
[{"txid":"notarealtxid78ahfjb73qhb54jhb6fe7f7efkjbekshc9jh38394394hddskdskflnotarealtxid","vout":0}] {"1NotARealBitcoinAddress":0.01}
command:
bitcoin-cli createrawtransaction $(cat ./tx.json)
...and it works fine.
To send yourself change, the outputs must be as below
anotherTx.json:
[{"txid":"notarealtxid78ahfjb73qhb54jhb6fe7f7efkjbekshc9jh38394394hddskdskflnotarealtxid","vout":0}] {"1NotARealBitcoinAddress":0.01,"1NotMyChangeBitcoinAddress":0.0005}
2 inputs instead of 2 outputs goes like
yetAnotherTx.json:
[{"txid":"notarealtxid78ahfjb73qhb54jhb6fe7f7efkjbekshc9jh38394394hddskdskflnotarealtxid","vout":0},{"txid":"anothertxidthatsnotreal47fhsifb8e928s8hdjpququ7sdmwisw5lttyp","vout":0}] {"1NotARealBitcoinAddress":0.01}
The same command works for both:
bitcoin-cli createrawtransaction $(cat anotherTx.json)...again, 1 space only in the entire string that is between the ins and the outs, no returns, and no quotes around anything except the fields and their values. These magic spells on the linux CLI