![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| compare files | prashanth.spl | Shell Programming and Scripting | 0 | 06-18-2008 05:22 PM |
| compare files | danabo | Shell Programming and Scripting | 3 | 05-19-2008 01:09 PM |
| compare two files | charandevu | Shell Programming and Scripting | 7 | 03-30-2008 04:20 PM |
| Compare two files | penfold | Shell Programming and Scripting | 3 | 04-29-2005 12:04 AM |
| compare files and beyond | MizzGail | UNIX for Dummies Questions & Answers | 2 | 04-25-2003 02:34 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Quote:
Code:
#!/bin/sh
awk 'NR==FNR{a[$0]=$0;next}
$0 in a {print $0 > "dup_file";next}
{print $0 > "no_dup_file"}
' fileA fileB
Replace the filenames with your filenames and if you get errors use nawk, gawk or /usr/xpg4/bin/awk on Solaris. Regards |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|