If you are trying to get input of a password, that is certainly not how to do it.
First, the comparison password should be stored as a hash. Create that with md5sum
for example:
echo hello | md5sum
gives
b1946ac92492d2347c6235b4d2611184 -
Now to get the input, we can use @Serg's answer, slightly modified. We use the -s
to hide the input (keep it secret).
echo Please enter password:
read -s input
and compare it to the hash:
input=$(echo $input | md5sum)
if [ $input == "b1946ac92492d2347c6235b4d2611184 -" ]
then
echo "Welcome, your password was correct"
else
echo "Sorry, wrong password"
fi
sed
for this task, specifically? As it stands, this isn't really a question within the terms of this site - please take a look at How do I ask a good question?