G
G
gerrrper2014-10-09 14:53:14
bash
gerrrper, 2014-10-09 14:53:14

How to send authorization data to the console in bash?

For example, do a git clone over http when git asks for a username and password. How to send this data to the console?
Here's a design that doesn't work.

login="12345"
password="67890"

git clone http://gitlabdomain/pgroup/project.git
expect "^Username*"
send -- "$login\r"
expect "^Password*"
send -- "$password\r"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2014-10-09
@gerrrper

git clone http://USERNAME:[email protected]/pgroup/project.git

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question