1
./monero-wallet-cli --wallet-file=XXXX --daemon-address YYYYY --command "balance"

When I use the above command, it gives me the ability to see my balance, but how do I make it where it doesn't output the startup message when monero cli starts?

enter image description here

End result, I just want to be able to output the balance and save it to a file or pass it into an argument of another command like grep.

1 Answer 1

1

When I use the above command, it gives me the ability to see my balance, but how do I make it where it doesn't output the startup message when monero cli starts?

The simplest way (*nix) is:

monero-wallet-cli --wallet-file your-wallet --password 'your-password' \
    --command balance | tail -2

You can of course pipe through anything that accepts data on stdin.

Another example:

monero-wallet-cli --wallet-file your-wallet --password 'your-password' \
    --command accounts | tail -n +15 | head -n -3

Removes the header and footer from accounts output displaying everything in between.

2
  • but that wouldnt work for a command like 'account' which could have many subaddresses. Jan 21, 2021 at 20:58
  • You asked specifically wrt the "balance" command. You can pipe any command output and parse however you like with tail, grep, sed, awk etc etc.
    – jtgrassie
    Jan 22, 2021 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.