$ diff --help |grep -i exit Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.