I need to create a script where if there are new alias created, it will dump to a file. I use diff. rsync the alias file every 5 mins and compare the new one to the old one.

However, if there are remove aliases, it still dump to a file. That is the problem. Can diff recognize the new text and removed text? Or do I need to use other language? I tried a create script as simple as possible that's why I'm using shell.