LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 11-01-2005, 02:35 AM   #1
anandss2004
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.
anand
 
Old 11-01-2005, 08:00 AM   #2
Dtsazza
Member
 
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
J_K9
Member
 
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.

M.
 
  


Reply


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 09:44 AM.

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