BitShares Forum
Main => General Discussion => Topic started by: merockstar on November 26, 2014, 12:36:35 pm
-
someone wrote this bash script for me and I found it useful. I'm not much of a programmer but it looks alright to me, can anyone confirm? just replace INSERTPASTEBINURLHERE with the url of a pastebin of your wallet_check_sharedrop results
#!/bin/bash
sum=0;
while read bal
do
sum=sum+$bal;
done <<< `wget -q -O- INSERTPASTEBINURLHERE | grep original_balance | cut -d ":" -f2 | tr -d " "`
echo $sum
-
Not sure with the bash syntax .. but i can confirm it's safe to run ..
#!/bin/bash
sum=0;
while read bal
do
sum=sum+$bal;
done <<< `wget -q -O- INSERTPASTEBINURLHERE | grep original_balance | cut -d ":" -f2 | tr -d " "`
echo $sum
-
sum=sum+$bal;
That should be
sum=$(($sum + $bal))
instead.
-
sum=sum+$bal;
That should be
sum=$(($sum + $bal))
instead.
done.
but I got this
")02326245rror: invalid arithmetic operator (error token is "
0
so I'm going to switch it back.
-
Actually I wrote the script :P
Feel free to "bash" my scripting skills!
-
but I got this
")02326245rror: invalid arithmetic operator (error token is "
0
so I'm going to switch it back.
The error message is an indication that it's actually trying to calculate, which it wasn't before the change. Something's wrong with your input data.
(The whole pastebin / wget part is unnecessarily complicated IMO. Leave out the '<<< ... wget ... rest of the line...' part and c&p the output of wallet_check_sharedrop directly into the input.)
-
but I got this
")02326245rror: invalid arithmetic operator (error token is "
0
so I'm going to switch it back.
The error message is an indication that it's actually trying to calculate, which it wasn't before the change. Something's wrong with your input data.
(The whole pastebin / wget part is unnecessarily complicated IMO. Leave out the '<<< ... wget ... rest of the line...' part and c&p the output of wallet_check_sharedrop directly into the input.)
The reason the whole wget ... part is there is because I wrote this for myself while trying to help out merockstar on irc.
I I know it's not written well. I did it at like 4 in the morning :(
-
but I got this
")02326245rror: invalid arithmetic operator (error token is "
0
so I'm going to switch it back.
The error message is an indication that it's actually trying to calculate, which it wasn't before the change. Something's wrong with your input data.
(The whole pastebin / wget part is unnecessarily complicated IMO. Leave out the '<<< ... wget ... rest of the line...' part and c&p the output of wallet_check_sharedrop directly into the input.)
The reason the whole wget ... part is there is because I wrote this for myself while trying to help out merockstar on irc.
I I know it's not written well. I did it at like 4 in the morning :(
i appreciated the effort as well arubi. wanted to credit you but couldn't remember your name :P
pc, thanks for helping make it better, I'll give the direct copy/paste a try. Is the result I'm getting from the original wget arubi version of the script invalid then?