I was trying to create an account via geth. My question is about using the non-interactive password input.

With the following variables :

PASSWORD="${GETH_ROOT_PATH}/passwordfile.txt" => in this file, I have something like : 

l1: {ADDR1}password1

l2: {ADDR2}password2 


So I have tried this :

geth account new --datadir ${GETH_DATA_DIR} --password awk -F"$BR2" '[ print $2 ]' ${PASSWORD}

So what I wanted is to go to the password file and take the output following the "}" and to make it as the password of the account.

But it didn't work. Could you help please ?


You're password file syntax is incorrect, and is limited to one password per file followed by a single newline, not multiple passwords per file.

Are you on linux? If so I would hazard a guess that you're shell expansion is causing an issue as well, and whatever it is you're trying to accomplish is very unnecessary.


  • Thank you for your reply. Yes I am on a CentOS 7. I have tried this : geth account new --password <(echo $mypassword) and it worked with the previous definition of the variable mypassword, for a single account. What I'm trying now, is to create a loop for creating 7 accounts at the same time for example. I will continue my researchs. Thanks.
    – Kanka
    May 18 '18 at 8:13
  • No problem. If you don't mind marking my post as the answer that would be great :)
    – hextet
    May 18 '18 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.