Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

diff continue on error

I can't get diff to ignore file system errors and continue the directory comparison.

I run a diff -r on two very similar directories with broken files in it. How can I get a complete comparison, is there another way, diff exits with an Input/output error

like image 661
friedemann Avatar asked Nov 26 '25 05:11

friedemann


1 Answers

you probably can't stop diff exiting (unless you change & recompile the source), but I'd look into using 'find':

find . -type f -exec diff {} ../other/folder/{} \;

The 'find' command here returns a list of filenames and passes them to 'diff' one at a time for comparison. The path of the current file is represented by {}

like image 110
rivimey Avatar answered Nov 28 '25 20:11

rivimey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!