entering password from command line or file

Asked by P. David Flammer on 2012-06-08

I'm trying to script some push/pulls in bzr in linux. When I start the script, I would like to give my password to the script there (only when the script starts). It stores it in a bash variable. I then write it to temporary file and try the following:

bzr pull <addresstopull> < fileWithPassword.txt

That should use the file rather than stdin for the bzr pull. But it doesn't work. Any ideas of how I can do what I'm trying?

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
Jelmer Vernooij Edit question
Last query:
2012-06-08
Last reply:
2012-06-08
Jelmer Vernooij (jelmer) said : #1

You can either specify the username and password in the URL you're fetching from. This would require specifying the URL on the command-line though. E.g.:

 $ bzr pull sftp://jelmer:<email address hidden>/example/branch

Another alternative is to write a custom authentication.conf file with the password. This would require replacing ~/.bazaar/authentication.conf temporarily as I don't see any way to override the location for that configuration file.

For more details, see "bzr help authentication".

Can you help with this problem?

Provide an answer of your own, or ask P. David Flammer for more information if necessary.

To post a message you must log in.