|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
"diff" question
hi everybody,
i had a question regarding the "diff" command. if i do "diff filea fileb > filec" is there a way to keep only the data differences ignoring the ">", "----", line numbers, etc that diff prints along with the differences ?? any help would be greatly appreciated ![]() |
|
#2
|
|||
|
|||
|
Well, looking at the man pages for diff doesn't seem too encouraging for having diff itself do it, or any of its variants for that matter either (taken from man pages on a Solaris 8 Sparc system)
You could get the results you want from other programs however: First, diff the files to a third file, I'll call it newfile, and then run something like the following: cat newfile | sed s/\<\ //g | sed s/\>\ //g > cleanfile Basically, that will remove all the '<' and '>' and the following spaces (so as to align the output properly to the left margin). Run another sed command and you could get rid of the '---' and number lines as well. Or, awk might work as well. Hope this helps. -Gary |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > "diff" question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|