Given the output below (simplified) extracted from the comparison of two curl -I commands saved in two different files, I am looking for the best approach to highlight the following scenarios in a script:
- this header exists only in file1.txt but this one does not
- this one exists in both cases but the values are different
I was thinking about assigning green color to column 3, orange color if the header is found both in column 1 and column 2 and no color if the header is found only either in column 1 or column 2...
I am also open to suggestions different from colors and by processing file1.txt and file2.txt with other options than comm command.
root# comm <(sort file1.txt | tr '.' ',') <(sort file2.txt | tr '.' ',')
Accept-Ranges: none
Cache-Control: private, max-age=0
Cache-Control: public, max-age=14400
CF-Cache-Status: HIT
HTTP/1,1 200 OK