I trying to write a script in bash that take a list of users in �fileA� and searches another list user in �fileB� if the user does not exist in �file B� write the user to another file �file C�.
Please note �fileA� and �fileB� contains over 1000 users
Basically
�fileA� �fileB�
Abc Tom
Def John
Tom Jonathan
Paul Paul
Wood Graham
Result in FileC
Abc
Def
Wood
Here my attempt
for i in `cat fileA`; do grep �w $i fileB; test [$? �ne 0] && echo $i >fileC fi; done
Can you help please my attempt is not working?
Thanks