I have the output from my diff command between two directories store in a file called differenceOutput.txt.
At present there are only two kinds of lines in differenceOutput.txt So all lines have either format A or B, where A and B look like this:
A)
Only in /tmp/__tmp_comp206_alex/test_files/: file_1.txt
B)
Files /tmp/__tmp_comp206_alex/test_files/file_3.conf and /tmp/__tmp_comp206_alex/diff_dir/file_3.conf differ
Using sed, I want to change all lines in differenceOutput.txt with format A to format C, and all lines with format B to format D, where C and D look like this:
C)
/tmp/__tmp_comp206_alex/test_files/file_1.txt is missing
D)
/tmp/__tmp_comp206_alex/diff_dir/file_3.conf differs
How can I do this with sed? Super confused with the sed syntax. I've spent hours trying to figure this out but can't make heads or tails of this. Can someone help me out please?
:? Can they contain anandsurrounded by spaces?cmpthough.