In a shell script file I am using some commands like scp and make install which ask for my password.
I run a shell script to compile a big project, and after some time it asks for my password for using scp. I need to wait for that process and give the password after that.
I just want to do it all by shell script without interaction, so how can I avoid being prompted for the password here?
If you can’t use ssh trust and must enter the password later on in your script, use
read -s -p "Password:" USER_PASSWORDto silently read in the password. You can thenexport USER_PASSWORDto an expect script, avoiding it being displayed inps: