LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   help on diff command (https://www.linuxquestions.org/questions/programming-9/help-on-diff-command-378855/)

anandss2004 11-01-2005 02:35 AM

help on diff command
 
I have two files having one line each.

file a:
ENTER-INPUT-Pid:00005048 ThreadID:0x0000002a95afa0a0 [2005/11/01 09:44:40]

file b:
ENTER-INPUT-Pid:00005048 ThreadID:0x0000002a95afa0a0 [2005/11/01 04:46:60]

-------------------
as one can see only text in side [] differs,

Please tell me the diff command option usage in such a way that diff command ignore this difference.

thanks in advance.
anand

Dtsazza 11-01-2005 08:00 AM

Have you checked the man page? All of the command switches are listed there, so you can see whether one does what you want or not. Having had a quick look through it, though, I doubt you'll have much luck. If I understand correctly, you're asking if you can supply diff with some kind of regular expression which you want it to ignore... IMHO, this is far beyond what diff was meant to do and isn't likely to be supported.

One option that pops to mind is to strip the timestamps off with sed, then pass the modified files to diff. If it discovers any differences, then you know there were differences in the original files, independent of the text in the square brackets.

J_K9 11-01-2005 12:58 PM

I'm not sure if Meld will be of any use, but if it isn't then maybe one of the other apps it mentions in the 'Links' at the bottom will be. :)

M.


All times are GMT -5. The time now is 04:01 AM.