The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
diff tungaw2004 UNIX for Dummies Questions & Answers 3 04-25-2007 11:54 AM
Diff b/w $@ and $# PradeepRed Shell Programming and Scripting 4 01-24-2006 04:02 AM
diff 2 files; output diff's to 3rd file blt123 Shell Programming and Scripting 2 05-28-2002 12:29 PM
Redirect <Therapy> IP Networking 1 03-20-2002 08:54 AM
diff and ed? Brototype UNIX for Dummies Questions & Answers 2 10-29-2001 02:30 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-28-2008
mail2sant mail2sant is offline
Registered User
  
 

Join Date: Apr 2008
Location: bangalore
Posts: 69
redirect after the diff

hi,

i have 2 file of the same kind

file_old and file_new

there are few extra things added in new file

i want to make diff file_old file_new > file_update

( file_update are the new things added as compare to the old file )

i can i make it clearly . bcoz in diff it show all the diff among

could someone please help me in that.
  #2 (permalink)  
Old 04-29-2008
summer_cherry summer_cherry is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2007
Location: Beijing China
Posts: 1,092

Code:
comm -13 old new

  #3 (permalink)  
Old 04-29-2008
mail2sant mail2sant is offline
Registered User
  
 

Join Date: Apr 2008
Location: bangalore
Posts: 69
its now working...
can u please suggest other way
  #4 (permalink)  
Old 04-29-2008
danmero danmero is online now Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,441
Maybe you need only new lines from file_new that don't exist on file_old

Code:
grep -vf file_old file_new

  #5 (permalink)  
Old 04-29-2008
mail2sant mail2sant is offline
Registered User
  
 

Join Date: Apr 2008
Location: bangalore
Posts: 69
what i am looking is

for eg:

file_old contains

abc1
abc2
abc3
abc4

file_new contains

abc1
abc2
abc3
abc4
abc5
abc6

is if i run the diff

i want

abc5
abc6
to be displayed
  #6 (permalink)  
Old 04-30-2008
gnom gnom is offline
Registered User
  
 

Join Date: Feb 2008
Location: New Zealand
Posts: 66
try this

diff old new | awk '{print $2}'

cheers
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0