help! im stuck..

I want to search for the line with the group name and add the user into the group. The file format is the same as /etc/group
The code i wrote is
egrep "^$newGID" $group >/dev/null

FS=":"
oldData=awk -F: '{print $3}'
newData= "$oldData,$newUser"
sed -n $4/$newData $group

but a friend told me that sed doesnt seem to have FS function. Could anybody help me out?

please post in the right forum and choose a better title! moved to "shell scripting...".