What I need to do is diff 2 files to check for changes. However both of these files have a certain 4 lines in them that are guaranteed to change and that I want to ignore for the diff. My idea is to use sed to remove the 4 lines using a regex which I can get to work no problem, however I must not be using the sed command right in the diff as I get the error "The system cannot find the file specified".
The sed command I'm using is:
sed "/regex1/,/regex2/ d" "filename"
This removes the 4 lines between the two regex's properly.
The diff command I'm trying is:
diff <(sed "/regex1/,/regex2/ d" "file1") <(sed "/regex1/,/regex2/ d" "file2")
and this is giving the error.
Can anybody tell me how I'm using diff wrong?
Thanks
I didn't have problem running the command you tried.
However I could use the command
sed ... | diff - <(sed ...)
with the same results
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With