Register
It is currently Mon Dec 22, 2014 4:11 am

compare 2 files using third file as an exceptin


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Thu Feb 13, 2014 9:59 am   

Joined: Thu Feb 13, 2014 9:54 am
Posts: 1
Hi All,

Is it possible to compare 2 files using the contents of a third file as a guide using a bash script?

I have 2 files I want to compare (1 and 2 below) the difference between the two is the first line (a)

I want my script to ignore this difference if the difference is stored in file3.

Is it possible to compare two files with the contents of the 3rd acting as an exception?

File 1
a
b
c


File2

b
c

File3
a

Thanks


Top
 Profile  
 PostPosted: Thu Feb 13, 2014 3:51 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 579
hi,

check grep's man page for -v and -f options.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP