So I need to check if the recipient username is in /etc/passwd which contains all the users in my class, but I have tried a few different combinations of if statements and g
Just do a simple if like this:
if grep -q $address /etc/passwd then echo "OK"; else echo "NOT OK"; fi
The -q option is used here just to make grep quiet (don't output...)