To make it unempty, you have to be able to open it. I think you can do this because you said all you saw were a bunch of ~ running down the page when you did.
I'm beginning to wonder if you have an /etc/group file that has anything in it. Do you? Here is what your /etc/group file should look like:
root::0:root
other::1:root,hpdb
bin::2:root,bin
sys::3:root,uucp
adm::4:root,adm
daemon::4:root,daemon
mail::6:root
lp::7:root,lp
ttyp::10:
nuucp::11:nuucp
users::20:root
nogroup:*:-2:
(There were default groups that were put in my system when I installed.)
Now, for the /etc/passwd file:
open /etc/passwd (vipw /etc/passwd). I will assume it is totally empty. Here are the steps for getting root in there:
In the open empty file do this:
type i (to get into insert mode)
type root:*:0:3::/:/bin/ksh
press Esc
type :wq! and press return
Remember: you cannot have an empty line or an empty character before the word root. vipw should prevent you from doing that.
At the command prompt type passwd and press return.
you should be prompted to type in a password for root. then you will be asked to type it again.
try to bring the system to init3 or init4. If you can't, it may be because you don't have the other accounts that things in the OS require.
Here are the default accounts that are created in the /etc/passwd file (besides root). the * in these account defnitions is not a mistake:
daemon:*:1:5::/:sbin/sh
bin:*:2:2::/usr/bin:/sbin/sh
sys:*:3:3::/:
adm:*:4:4::/var/adm:/sbin/sh
uucp:*:5:3::/var/spool/uucppublic:/usr/lbin/uucp/uucico
lp:*:9:7::/var/spool/lp:/sbin/sh
nuucp:*:11:11::/var/spool/uucppublic:/usr/lbin/uucp/uucico
hpdb:*:27:1:ALLBASE:/:sbin/sh
Since you don't have these very important files, I'm wondering what else you might not have and if it would be better if you did a complete reinstall. (But did you say you have the OS on a CD but no CD ROM on the system?