I like using bitcoind together with sx
altoidnerd@LEPTON:~$ bitcoind getnewaddress > a.txt; a=$(cat a.txt);bitcoind dumpprivkey $a | sx addr
1AhAcnWk92uce89jq5jTQNjHt9T4DuAKAZ
altoidnerd@LEPTON:~$ cat a.txt
1AhAcnWk92uce89jq5jTQNjHt9T4DuAKAZ
It works! But in the other direction, I can't get it quite right;
altoidnerd@LEPTON:~$ priv=$(sx newkey); echo $priv | sx addr > a.txt; a=$(cat a.txt); echo $a
1H441WDHRuXPTDosqjUKN54C44yuHY3upM
I want to do something like
altoidnerd@LEPTON:~$ bitcoind importprivkey $priv
or
altoidnerd@LEPTON:~$ echo $priv | bitcoind importprivkey
both of which seem to freeze bitcoind or return an error. I guess because bitcoind importprivkey doesn't like stdin?