creating a file by editing another one?

BASH shell:

I'm trying to create a copy of the /etc/passwd file named "./copy-passwd" that contains only the entries for userids that have a home directory in /home/inst, and then change each entry in the copy so that the default login shell is /bin/sh.

Would "sed" be the best choice of file editor? I'm not quite familiar with sed.

awk would be best.

awk -F: '$6 ~ /^\/home\/inst/ { $7="/bin/sh"; print; } {print}' /etc/passwd >copy-passwd

This isn't exactly what you asked for, but I think it's what you want. If you really don't want the other entries (the ones that have no /home/inst for a home dir), then remove the "{print}".