how i can input string from variable

hello every body
my system is solaris 8 and my problem is i have a lot of user to change password so i'm key password every user and i want to input password from variable
my script
grep xxx shadow |while read a
do
passwd $a
done
#new password : i'm typing manual but i want input from $a

Pls Help me  
                             thank you Best regrad
                                  infjustice

I'm sorry if message not understand i'm weak in english

I didn't try it so it may need some adjustement but maybe something like

grep xxx shadow |while read a 
        do
        echo "Enter passwd for user $a :"
stty -echo
read s
stty echo
echo "$s" | passwd $a
        done

?

Thank you sir

---------- Post updated at 09:03 PM ---------- Previous update was at 08:40 PM ----------

no not work your script not automate input password thank you very much sir