Ok, I am not quite sure how to phrase this correctly but does anyone know of a way to continuously read lines of a file and if one of those lines are found produce a message?
For example, if i have a list full of usernames and i store that int /home/username.txt`. then if one of the names that is found within user name is also found as a logged in user using the w command, produce a a message saying only that user which was found is logged on.
while read line
this is what i have tried using, however, it only picks up the last name in the list.
any help would be greatly appreciated!