Author Topic: a script for wallet_check_sharedrop results  (Read 1788 times)

0 Members and 1 Guest are viewing this topic.

merockstar

  • Guest

but I got this

Code: [Select]
")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?

Offline arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile

but I got this

Code: [Select]
")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 :(

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano

but I got this

Code: [Select]
")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.)
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile
Actually I wrote the script :P
Feel free to "bash" my scripting skills!

merockstar

  • Guest
Code: [Select]
            sum=sum+$bal;

That should be

Code: [Select]
            sum=$(($sum + $bal))

instead.

done.

but I got this

Code: [Select]
")02326245rror: invalid arithmetic operator (error token is "
0


so I'm going to switch it back.

Offline pc

  • Hero Member
  • *****
  • Posts: 1530
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BitShares: cyrano
Code: [Select]
            sum=sum+$bal;

That should be

Code: [Select]
            sum=$(($sum + $bal))

instead.
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Not sure with the bash syntax .. but i can confirm it's safe to run ..

Quote
Code: [Select]
    #!/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


merockstar

  • Guest
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

Code: [Select]
    #!/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

« Last Edit: November 26, 2014, 12:57:39 pm by merockstar »