Is there a way to make the diff
command look only for differences from a specified range of lines (from from line to to line), instead of the entire file? I am having difficulty trying to find the difference between two JavaScript functions in two files that are not on the same line. I could copy the range of lines into a new file, do the same for the other file, then compare them, but it would be tedious to do so especially since the files contain a lot of text.
I tried using:
diff "code1.js" "code2.js" --suppress-common-lines | tee outputFile
but it obviously does not show only the range of lines I am interested in comparing. It would be also useful if I could specify a range of lines to look for in one file and a different range of lines in the other file.