Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: a script for wallet_check_sharedrop results  (Read 341 times)

0 Members and 1 Guest are viewing this topic.

merockstar

  • Guest
a script for wallet_check_sharedrop results
« 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

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 »

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12275
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BTS: xeroc
  • GitHub: xeroc
Re: a script for wallet_check_sharedrop results
« Reply #1 on: November 26, 2014, 12:40:43 PM »
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

Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline pc

  • Hero Member
  • *****
  • Posts: 1219
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Re: a script for wallet_check_sharedrop results
« Reply #2 on: November 26, 2014, 12:50:53 PM »
Code: [Select]
            sum=sum+$bal;

That should be

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

instead.
Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

merockstar

  • Guest
Re: a script for wallet_check_sharedrop results
« Reply #3 on: November 26, 2014, 12:56:00 PM »
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 arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile
Re: a script for wallet_check_sharedrop results
« Reply #4 on: November 26, 2014, 02:09:23 PM »
Actually I wrote the script :P
Feel free to "bash" my scripting skills!

Offline pc

  • Hero Member
  • *****
  • Posts: 1219
    • View Profile
    • Bitcoin - Perspektive oder Risiko?
  • BTS: cyrano
  • Witness: cyrano
  • Payrate: 100%
Re: a script for wallet_check_sharedrop results
« Reply #5 on: November 26, 2014, 02:18:52 PM »

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.)
Please vote for my BitShares witness "cyrano" and for my STEEM witness "cyrano.witness"!
Bitcoin - Perspektive oder Risiko? ISBN 978-3-8442-6568-2 http://bitcoin.quisquis.de

Offline arubi

  • Sr. Member
  • ****
  • Posts: 209
    • View Profile
Re: a script for wallet_check_sharedrop results
« Reply #6 on: November 26, 2014, 02:42:55 PM »

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 :(

merockstar

  • Guest
Re: a script for wallet_check_sharedrop results
« Reply #7 on: November 27, 2014, 02:10:54 PM »

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?

 

Google+