Saturday, June 4, 2022

[SOLVED] how to autoinput in bash scripting

Issue

I'm tired to put username in this input by bash script i run the script but what shall i do when i rich to this line its expecting to input username

Vpn.sh: 1: H8JPgidIAO7T43IP: not found
Vpn.sh: 1: TEL5Fl5bZ6y857IihRmMKEJT0knhxutW: not found
🔐 Enter Auth Username: 

Solution

You can use expect:

#!/usr/bin/expect

spawn Vpn.sh  
expect  "Enter Auth Username:"   
send "ThePassword\r"
expect eof


Answered By - ErniBrown
Answer Checked By - Pedro (WPSolving Volunteer)