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.

Patoshi パトシ
  • 4,608
  • 4
  • 27
  • 69

1 Answers1

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.

jtgrassie
  • 19,601
  • 4
  • 17
  • 54