I want to have this script which will store users in the format:<$AccountName> <$DOB> <$Username><$Password> <$Email> on a file called Register.txt. I want to have it search the file to see if the username already exists in Register.txt before adding the account to the file. How do I go about doing this?
Add a comment
|
1 Answer
Extract the usernames, then search:
newuser="waltinator"
cut "-d " -f3 Register.txt | \
grep -F -w "$newuser" | \
wc -l
Read man cut grep wc.