usermod -p not working in HP Unix

Hi;

Im working on HP -UX B.11.11 U 9000/800 , I come from a Linux background and i m not so good at HP UX.Here is the issue

I need to reset the password of some 100 users at one go ,on linux I used to do it.I wrote a small code in linux and it worked a charm

here is the code ,where in I used to give a colon seperated file as an input.

cat $1|while read UID
do
NAME=`echo $UID|awk -F ":" '{print $1}'`
PASS=`echo $UID|awk -F ":" '{print $2}'`
#perl -e 'print crypt("$PASS", "salt"),"\n"'>/syed/var
pass=$(perl -e 'print crypt($ARGV[0], "imju%JHYlmnb")' $PASS)
usermod -p $pass $NAME
done

Now on HP UX it doesnt let me do it as there is not -p switch in HP UX. Can some one please help me with it

My input file format is like

username:password

Thanks in Advance

Hi All;

Finally the issue is now resolved ;I found a way of doing it using expect.

The reason I m posting a reply is to know if this forum is always so helpful.....:rolleyes:..:confused:

It's good to hear your problem is solved.

But would you like to share your new expect code?

And what's the meaning of -p switch?