![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Grep commands in loop | karthikn7974 | Shell Programming and Scripting | 0 | 04-28-2008 09:16 AM |
| while loop inside while loop | panknil | Shell Programming and Scripting | 0 | 01-07-2008 12:49 PM |
| grep and awk showing filename in loop | sjohns6 | Shell Programming and Scripting | 5 | 05-24-2007 08:59 AM |
| grep in a loop | gundu | Shell Programming and Scripting | 7 | 03-28-2005 04:59 PM |
| how to get the similar function in while loop or for loop | trynew | Shell Programming and Scripting | 3 | 06-17-2002 11:09 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
What I try to do is to get the different between alist and blist; in this case the result should be:
d e My alist is unknown list of data and so is blist. Let's say my alist contains: e b c a d and my blist contains: c a b Using the code that I have: #!/usr/bin/ksh cat blist | while read line do grep -V "$line" alist > data done What do I have to do to have a data file that contain: e d Please advise! I tried "diff" it is not worked! |
|
||||
|
Quote:
Code:
#!/usr/bin/ksh # mydiff: gets the diff of two files and writes # the difference to a third file. cp alist data cat blist | while read line do grep -v "$line" data > /tmp/data mv /tmp/data data done # end mydiff |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|