Cannot use diff and cannot use cmp.
We are able to use comm with success, but I am not getting the correct results when used with a conditional in script.
#!/bin/bash
# http://stackoverflow.com/a/14500821/175063
comm -23 <(sort /home/folder/old.txt) <(sort /home/folder/new.txt)
if [ $? -eq 0 ];then
echo "There are no changes in the files"
else
echo "New files were found. Return code was $?"
fi
It always returns:
There are no changes in the files
as the comm command, runs successfully but the contents of the files are different.
I am very limited as to what can be added to this server as it is a corporate LINUX box.