The first field is the username, the second is the password, and the last indicates the action (login/register)
File 1: User input
File 2: Plain text database
admin,123 user,321 foo,bar
How can i compare the user input with the database to check if the username already exists?
I´ve tried the following code, but it´s not working:
if cut -d "," -f1 user_input | grep -wf user_input database; then echo "This username is already in use, try again!" else echo "Successfully registered!" fi
PS: i need a solution without awk,sed or find, just grep and cut