I want to append password in /etc/shadow file

Hi,
I want to append password into /etc/shadow file using a shell script.
My below script does add the users to both /etc/passwd and /etc/shadow but how can I add the hordcoded passwords to /etc/shadow file can some one help me ?

# To add the groups into /etc/group file

for a_user in nortel admin netmgr master operator ttbuser orbix oracle
do
/usr/sbin/useradd $a_user >> one
done

The password in /etc/shadow is encrypted. To add/change a password, use the passwd command (see the man pages for options).

cheers

Passwd command works in Interactive mode and I cant use expect also. I just want to hard code users and there password in one script.

# To add the users into /etc/password file
for a_user in nortel admin netmgr master operator ttbuser orbix oracle
do
/usr/sbin/useradd $a_user
done
This will add the users into /etc/password and /etc/shadow file. But how can I add passwords into shadow file withought using expect and in non Interactive mode ?

I'll tell you what I do, but it is a little risky. First I add the users to a "prototype" box. This is just some box where I start. I add the users, assign initial passwords, and I ask the user to sign on, change their passwords, and be sure that they like the shell, gcos info etc. I do not want to copy this around and then find that they csh or something. After the users accounts are all ready on the prototype box, I extract their lines from /etc/password and /etc/shadow. I use this to create a simple script that appends the lines to /etc/passwd and /etc/shadow. The script also makes the home directories, etc. I test this script on a test system. Once I am sure that I trust the script, I use an automated procedure to transfer to the boxes in question and run it. Like I said, this is a little risky. But I am careful and I am confident that I can correct any fumbles that occur.

Your view is challenging and good one but I cant use any of these system files too because of project requirment. I should use solaris commands like sed or cat which can append the hardcoded passwords into /etc/shadow file.
If you can write one command (sed or any one else) then it will be good help for me.
Thanx a lot

#! /usr/bin/ksh
cat >> /etc/passwd << \EOF
joeblow:x:1158:20:Joseph Q Blow:/home/joeblow:/bin/ksh
tomjones:x:1159:20:Thomas Jones:/home/tomjones:/bin/ksh
EOF
cat >> /etc/shadow << \EOF
joeblow:xxxxyyyyzzzz1:13220::::::
tomjones:xxxxyyyyzzzz1:13220::::::
EOF
exit 0