Hi,
I'm sorry for this basic question. I can't for the life of me remember how to do it and no lack of Google searches has found me an answer.
I simply wish to compare 2 files using
diff and perform an action if they are different (e.g. move the file that's different).
I'm using:-
diff -q file01 file02
and get:-
Files file01 and file02 differ
Does the
diff -q produce some kind of standard out that I can use in a simple
if statement, such as:-
if [ diff -q file01 file02 ] then
echo Files different
else
echo Files same
fi
I did actually try that, but of course didn't work
. Once again sorry for the simple question, I'm expecting to kick myself once I find out how it's done
.
Cheers,
KISA