Score:0

How to pass credentials, when it prompt in shell script

cn flag
Tej

Here is my request,

i need to pass credentials in shell script

here is my flow: when the below thing prompts those credentials should be in my shell script, so that i can use that script, instead of typing it every time i login to env. my code did not work:

#!/bin/bash

cd $HOME/some_env
pwd
source bin/activate
some_client request_access
#expect "Username:"
expect "user\r"
#expect "Password:"
expect "password\r"
#interact

Provide credentials for somthing.com
Username:
Password:

I need to write a shell script in such a way that i need to pass above details.

Thanks in advance

waltinator avatar
it flag
Are you using Ubuntu? Which release? Read https://askubuntu.com/questions/how-to-ask
bac0n avatar
cn flag
You can use [autoexpect](http://manpages.ubuntu.com/manpages/focal/en/man1/autoexpect.1.html) for this.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.