pull down to refresh

I've been trying to parse in Bash (with grep and sed) the output of lightning-cli listpeerchannels in order to compute the total spendable and total receivable msats. Has anyone already written this?
It is easy to parse it when there is only one channel, not so easy for two or more.

If the cli returns json, you can use jq to process it.

jq has a pretty great math scripting.

reply