LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Comparing two files to get matched contents in another file using shell script (http://www.linuxquestions.org/questions/linux-networking-3/comparing-two-files-to-get-matched-contents-in-another-file-using-shell-script-660505/)

pooppp 08-04-2008 11:18 PM

Comparing two files to get matched contents in another file using shell script
 
File a & file b is the input file & file c is o/p file
How to compare filea & fileb
-------------------------

file a

1
2
3
4
--------------------

file b

a
b
1
2
3
g
------------------

result file c

1
2
3
----------------
Help me

bhaslinux 08-04-2008 11:28 PM

######### file a
$ cat a
1
2
3
4

########file b
$ cat b
a
b
1
2
3
######### command
$ grep -f b a
1
2
3

pooppp 08-05-2008 12:05 AM

Command is not required..can u write script for above one?

Plz anyone Help me.........

billymayday 08-05-2008 12:11 AM

This looks a lot like homework, and it's certainly a double post

http://www.linuxquestions.org/questi...script-660343/


All times are GMT -5. The time now is 07:03 AM.