How to input a password when using an alias

I am using sshpass in order to perform a scp command inside a pretty long script to run and I would like to be able to input a password in advance for this.

It's pretty easy to use the password as a parameter, but then, it's typed in clear in the terminal and is obviously a security breach.

My question is : is it possible to ask for the password so that it doees not appear in the terminal at the start of the script ?


You can use read with -p switch to enter a password:

read -s -p "Enter Password: " password
sshpass -p "$password" ...