Problem in reading file (bash)

i get a name from user first name : last name, in this format. Now i am saving this to a file. what i want is, I do not want to save any name if I already have one entry o that same name..what should i do

for example
user give robert fernandez
this will save in file as robert:fernandez.
if user give same name in future i dont want tht to be saved in the file, instead it should give message that this name is already there.

Thanks

listfile is the list of names

newname="robert:fernandez"
grep -q "$newname"   listfile

if [[ $? -eq 0   ]; then
  echo "not okay"
  # insert  code to handle an existing entry
else
  echo  "ok"
  # code to handle new name
fi
#!/bin/bash
read -p "First name: " FN
read -p "Last name : " LN
NAME="${FN}:${LN}"
if grep -q "$NAME" listfile
then
  echo "$NAME already in file"
else
  echo "$NAME" >> listfile && echo "adding name to file"
fi

thanks

Here is a square bracket open too much.
When one is removed, the code works perfectly.

Regards,
pc

All of those grep invocations should be using -xF to ensure that a fixed-string full-line match occurs.