Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-01-2005, 02:35 AM   #1
LQ Newbie
Registered: Oct 2005
Location: Japan
Posts: 6

Rep: Reputation: 0
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.
Old 11-01-2005, 08:00 AM   #2
Registered: Oct 2005
Location: Oxford, UK
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282

Rep: Reputation: 30
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.
Old 11-01-2005, 12:58 PM   #3
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700

Rep: Reputation: 30
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.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
patch -p1 x.diff but no patch command!? pyenos Linux - Hardware 1 03-04-2005 03:10 PM
What is the diff between / and // stardotstar Linux - Newbie 1 09-30-2004 01:02 AM
Dual Boot diff Hard Disk diff OS on Suse 9.1 wilhem Linux - Newbie 1 08-13-2004 06:06 PM
What a Diff! perry General 0 12-05-2003 07:10 PM
the diff command or any other similar things murshed Linux - Newbie 4 02-12-2003 10:07 PM

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration