I didn't know about that of integers and floats. Anyways, I managed to get it working somehow. This script is working with a different method (bitcoin-cli sendmany) and I tried it and it did the correct math andd sent the correct amount of BTC into 2 adddresses.arzgi wrote:I have nothing to add to what ruwolf and Dai_trying have said, but you know bash only supports integers?
If you know how long would the floating number would be, you could multiply it to get to an integer number.
Above, and the lack of return value in functions are the reasons why I use bash only for starter scripts and like.
Python in my mind too is better for general programming.
You can see the script here. But I need to change the sendmany method because that will only work in a specific situation which isn't what I need. So I need to use "listunspent" and use the values returned by this method in the math needed.
I'll check when I get it working. I couldn't dod anything yesterday because I had to fix another issue. My node decided to corrupt blocks so I had to fix that. No node, no script testing.
I'll try to work on the script today!