Hi,
I'm trying to spearate the output of the diff command between each result of the command with a new line but can't figure out how..
Here's a sample output from diff:
$ diff file1 file2
2d1
< ABCDEFG 12343
4c3
< ABCDEFG 12345
---
> ABCDEFG 1234x
7a7
> ABCDEFG 12341
I want to pipe it to something and make it look like this:
$ diff file1 file2 | $SOMETHING
2d1
< ABCDEFG 12343
4c3
< ABCDEFG 12345
---
> ABCDEFG 1234x
7a7
> ABCDEFG 12341
My goal here is to create a report daily that shows changes to a controlled file (audit the file). I'll copy it daily and run the diff command against it the current day and yesterday. I need to identify the a,c,d of diff and then report accordingly.. For example,
"On 9/24 ABCDEFG 1234x was ABCDEFG 12345 - This field has been CHANGED"
"On 9/24 ABCDEFG 12341 was ADDED" etc, etc..
Since I'm going to do this on AIX I plan on using grep -p to get the paragraph output of diff and then parse..
I'm struggling here... thanks!
I'm trying to spearate the output of the diff command between each result of the command with a new line but can't figure out how..
Here's a sample output from diff:
$ diff file1 file2
2d1
< ABCDEFG 12343
4c3
< ABCDEFG 12345
---
> ABCDEFG 1234x
7a7
> ABCDEFG 12341
I want to pipe it to something and make it look like this:
$ diff file1 file2 | $SOMETHING
2d1
< ABCDEFG 12343
4c3
< ABCDEFG 12345
---
> ABCDEFG 1234x
7a7
> ABCDEFG 12341
My goal here is to create a report daily that shows changes to a controlled file (audit the file). I'll copy it daily and run the diff command against it the current day and yesterday. I need to identify the a,c,d of diff and then report accordingly.. For example,
"On 9/24 ABCDEFG 1234x was ABCDEFG 12345 - This field has been CHANGED"
"On 9/24 ABCDEFG 12341 was ADDED" etc, etc..
Since I'm going to do this on AIX I plan on using grep -p to get the paragraph output of diff and then parse..
I'm struggling here... thanks!