Unix/Linux Go Back    



Extract common data out of multiple files

UNIX for Dummies Questions & Answers




Kindly Note - This is a Single User Post by Forum Member mukulverma2408 Regarding:
Extract common data out of multiple files.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 12-30-2012   -   Original Discussion by macmath
mukulverma2408 mukulverma2408 is offline
Registered User
 
Join Date: Jul 2012
Last Activity: 16 November 2017, 9:10 PM EST
Posts: 76
Thanks: 28
Thanked 2 Times in 2 Posts
Hi sathyaonnuix,
Consider the below scenario :

Code:
cat filea
line1
line2
repeat1
line3
repeat2
line4
repeat1


Code:
cat fileb
1234567
repeat1
repeat2
bbbbbb


Code:
cat filec
line1
repeat1
repeat2
line2
repeat1
line3

Now executing the script for these three files would result in below output

Code:
repeat1
repeat2
repeat1

repetition of repeat1 which i think was not required

P.S. I am running while loop on filea