How to take the number including dot from an output of one command and use it in another one?
For example, this command
chia wallet show -w standard_wallet
gives this result
Wallet height: xxxxxx
Sync status: Synced
Balances, fingerprint: xxxxxxx
Chia Wallet:
-Total Balance: 0.192267662015 xch (192267662015 mojo)
-Pending Total Balance: 0.192267662015 xch (192267662015 mojo)
-Spendable: 0.192267662015 xch (192267662015 mojo)
I want to take the number 0.192267662015
from the Spendable
line to use in another command which will become
chia wallet send -a 0.192267662015
There will only be one Chia Wallet
section in the output, and only one Spendable
line.
How to write a script to do this? I have been looking up to grep
, sed
and xargs
but not sure how to put them in the use correctly.